Files
react-test/docs/data/material/components/badges/CustomizedBadges.tsx

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
667 B
TypeScript
Raw Normal View History

2025-12-12 14:26:25 +09:00
import Badge, { BadgeProps } from '@mui/material/Badge';
import { styled } from '@mui/material/styles';
import IconButton from '@mui/material/IconButton';
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
const StyledBadge = styled(Badge)<BadgeProps>(({ theme }) => ({
'& .MuiBadge-badge': {
right: -3,
top: 13,
border: `2px solid ${(theme.vars ?? theme).palette.background.paper}`,
padding: '0 4px',
},
}));
export default function CustomizedBadges() {
return (
<IconButton aria-label="cart">
<StyledBadge badgeContent={4} color="secondary">
<ShoppingCartIcon />
</StyledBadge>
</IconButton>
);
}