Mui:styled
lastmod 2022-12-23created 2022-12-134 edits
Utility for creating styled components.
Categories
Examples
Overriding a div
const MyComponent = styled('div')({
color: 'darkslategray',
backgroundColor: 'aliceblue',
padding: 8,
borderRadius: 4,
});
Overriding a mui component
import Paper from '@mui/material/Paper';
const Item = styled(Paper)(({theme}) => ({
backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff',
...theme.typography.body2,
padding: theme.spacing(1),
textAlign: 'center',
color: theme.palette.text.secondary,
}));
See also
Favorite site
Pages that link here