Shadows
Add or remove shadows to elements with box-shadow utilities.
Mui core shadows
We used core shadows as provided by MUI. Refer: https://mui.com/system/shadows/
Customized customShadows
customShadows
There are few shadows that we customized as per theme's need. check here: src\themes\shadows.tsx
.
Demo: https://berrydashboard.io/utils/util-shadow
How to use
Import MUI theme
Use shadow with an element.
import {useTheme} from '@mui/material/style';
function YourComponent() {
const theme = useTheme();
return (
<>
...
...
// normal shadow
<Box sx={{ boxShadow: theme.customShadows.z1 }}>....</Box>
// shadows according to palette
<Box sx={{ boxShadow: theme.customShadows.primary }}>....</Box>
...
...
</>
)
}
Last updated
Was this helpful?