21 lines
551 B
JavaScript
21 lines
551 B
JavaScript
|
|
import { styled } from '@mui/material/styles';
|
||
|
|
import IconButton from '@mui/material/IconButton';
|
||
|
|
import Badge, { badgeClasses } from '@mui/material/Badge';
|
||
|
|
import ShoppingCartIcon from '@mui/icons-material/ShoppingCartOutlined';
|
||
|
|
|
||
|
|
const CartBadge = styled(Badge)`
|
||
|
|
& .${badgeClasses.badge} {
|
||
|
|
top: -12px;
|
||
|
|
right: -6px;
|
||
|
|
}
|
||
|
|
`;
|
||
|
|
|
||
|
|
export default function IconButtonWithBadge() {
|
||
|
|
return (
|
||
|
|
<IconButton>
|
||
|
|
<ShoppingCartIcon fontSize="small" />
|
||
|
|
<CartBadge badgeContent={2} color="primary" overlap="circular" />
|
||
|
|
</IconButton>
|
||
|
|
);
|
||
|
|
}
|