Created
September 16, 2021 22:51
-
-
Save chadmuro/2a923719173a6113980aeb29ca2f754a to your computer and use it in GitHub Desktop.
MUI sx prop
This file contains hidden or 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
import * as React from 'react'; | |
import TrendingUpIcon from '@mui/icons-material/TrendingUp'; | |
import { Box } from '@mui/system'; | |
export default function Example() { | |
return ( | |
<Box | |
sx={{ | |
bgcolor: 'background.paper', | |
boxShadow: 1, | |
borderRadius: 1, | |
p: 2, | |
minWidth: 300, | |
}} | |
> | |
<Box sx={{ color: 'text.secondary' }}>Sessions</Box> | |
<Box sx={{ color: 'text.primary', fontSize: 34, fontWeight: 'medium' }}> | |
98.3 K | |
</Box> | |
<TrendingUpIcon | |
sx={{ color: 'success.dark', fontSize: 16, verticalAlign: 'sub' }} | |
/> | |
<Box | |
sx={{ | |
color: 'success.dark', | |
display: 'inline', | |
fontWeight: 'medium', | |
mx: 0.5, | |
}} | |
> | |
18.77% | |
</Box> | |
<Box sx={{ color: 'text.secondary', display: 'inline', fontSize: 12 }}> | |
vs. last week | |
</Box> | |
</Box> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment