MUI, Material UI- For React js
Material Design with MUI v5.7.0
* MUI Installation Documentation
Install
npm install @mui/material @emotion/react @emotion/styled
Importing the Components import { Toolbar, Typography } from "@mui/material";
* MUI Installation Documentation
Install
Install Icons
npm install @mui/icons-material
MUI Components in v5.0
COMPONENTS IN MUI
Install Icons
MUI Components in v5.0
Container
The container centers your content horizontally. It's the most basic layout element.
maxWidth | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false | string | 'lg' | Determine the max-width of the container. The container width grows with the size of the screen. Set to false to disable maxWidth . |
Typography
Use typography to present your design and content as clearly and efficiently as possible.
variant | 'body1' | 'body2' | 'button' | 'caption' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'inherit' | 'overline' | 'subtitle1' | 'subtitle2' | string |
Button
The Button
comes with three variants: text (default), contained, and outlined.
import Button from '@mui/material/Button';
size 'small'
| 'medium'
| 'large'
| string 'medium' The size of the component. small
is equivalent to the
dense button styling.
variant 'contained'
| 'outlined'
| 'text'
| string 'text' The variant to use.
color 'inherit'
| 'primary'
| 'secondary'
| 'success'
| 'error'
| 'info'
| 'warning'
| string 'primary' The color of the component. It supports those
theme colors that make sense for this component.
<Container> <Paper elevation={5} variant="outline" p={5}> the quick brown fox jumps over the lazy dog the quick brown fox jumps over the
lazy dog the quick brown fox jumps over the lazy dog the quick brown fox
jumps over the lazy dog </Paper> <Button mt={5} color="primary" variant="contained"> read more </Button> </Container>
The Button
comes with three variants: text (default), contained, and outlined.
size | 'small' | 'medium' | 'large' | string | 'medium' | The size of the component. small is equivalent to thedense button styling. |
variant | 'contained' | 'outlined' | 'text' | string | 'text' | The variant to use. |
color | 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning' | string | 'primary' | The color of the component. It supports those theme colors that make sense for this component. |
Box
The Box component serves as a wrapper component for most of the CSS utility needs
<Box p={5}> <Typography variant="h4"> the quick brown fox jumps over the lazy dog the quick brown fox jumps over the lazy dog the quick brown fox jumps over the lazy dog the quick brown fox jumps over the lazy dog the quick brown fox jumps over the lazy dog the quick brown fox jumps over the lazy dog </Typography> </Box>
Paper
In Material Design, the physical properties of paper are translated to the screen.
The background of an application resembles the flat, opaque texture of a sheet of paper, and an application's behavior mimics paper's ability to be re-sized, shuffled, and bound together in multiple sheets.
import {Container, Paper} from '@material-ui/core';
variant 'elevation'
| 'outlined'
| string 'elevation' The variant to use.
elevation integer 1 Shadow depth, corresponds to dp
in the spec. It accepts values between 0 and 24 inclusive.
<Container> <Paper elevation={5} variant="outline" p={5}> the quick brown fox jumps over the lazy dog the quick brown fox jumps over the
lazy dog the quick brown fox jumps over the lazy dog the quick brown fox
jumps over the lazy dog </Paper> </Container>
In Material Design, the physical properties of paper are translated to the screen.
The background of an application resembles the flat, opaque texture of a sheet of paper, and an application's behavior mimics paper's ability to be re-sized, shuffled, and bound together in multiple sheets.
variant | 'elevation' | 'outlined' | string | 'elevation' | The variant to use. |
elevation | integer | 1 | Shadow depth, corresponds to dp in the spec. It accepts values between 0 and 24 inclusive. |
Table
Tables display sets of data. They can be fully customized.In Material Design there is different kinds of data tables are there, they are
<Table />
<TableBody />
<TableCell />
<TableContainer />
<TableFooter />
<TableHead />
<TablePagination />
<TableRow />
<TableSortLabel />
EX ::