A Pen by Homer Simpson on CodePen.
Created
February 3, 2023 23:23
-
-
Save HomerJSimpson/d8c4dbc801247a0093317f294a4f8c91 to your computer and use it in GitHub Desktop.
MuiSimple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="container"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
Box, | |
List, | |
ListItem, | |
ListItemButton, | |
ListItemText, | |
ThemeProvider, | |
createTheme, | |
Typography, | |
CssBaseline | |
} = MaterialUI; | |
const theme = createTheme({}); | |
const root = ReactDOM.createRoot(document.getElementById("container")); | |
root.render( | |
<ThemeProvider theme={theme}> | |
<CssBaseline /> | |
<header>top</header> | |
<main> | |
<section id="app"> | |
<List dense> | |
{Object.keys(window).map((e, i) => { | |
return ( | |
<ListItem disablePadding> | |
<ListItemButton component="a" href="#simple-list"> | |
<ListItemText primary={e} /> | |
</ListItemButton> | |
</ListItem> | |
); | |
})} | |
</List> | |
</section> | |
</main> | |
<footer>bottom</footer> | |
</ThemeProvider> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js"></script> | |
<script src="https://unpkg.com/@mui/material@latest/umd/material-ui.development.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/fuzzysort.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html, | |
body { | |
margin: 0; | |
height: 100%; /* can also use viewport units (height: 100vh) */ | |
} | |
#container { | |
display: flex; /* displays flex-items (children) inline */ | |
flex-direction: column; /* stacks them vertically */ | |
height: 100%; /* needs to take the parents height, alternative: body {display: flex} */ | |
} | |
main { | |
flex: 1; /* takes the remaining height of the "container" div */ | |
overflow: auto; /* to scroll just the "main" div */ | |
} | |
section { | |
height: 100%; /* takes the visible area of the "main" div */ | |
overflow: auto; /* recommended */ | |
border-bottom: 1px solid; | |
} | |
header { | |
} | |
section:last-child { | |
border: none; | |
} | |
footer { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" /> | |
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment