Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions docs/data/material/components/avatars/BadgeAvatars.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { styled } from '@mui/material/styles';
import Badge from '@mui/material/Badge';
import Avatar from '@mui/material/Avatar';
import Stack from '@mui/material/Stack';
import InsertDriveFileIcon from '@mui/icons-material/InsertDriveFile';

const StyledBadge = styled(Badge)(({ theme }) => ({
'& .MuiBadge-badge': {
Expand Down Expand Up @@ -46,16 +47,28 @@ export default function BadgeAvatars() {
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
variant="dot"
>
<Avatar alt="Remy Sharp" src="/static/images/avatar/1.jpg" />
<Avatar alt="Remy Sharp, online" src="/static/images/avatar/1.jpg" />
</StyledBadge>
<Badge
overlap="circular"
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
badgeContent={
<SmallAvatar alt="Remy Sharp" src="/static/images/avatar/1.jpg" />
}
badgeContent={2}
color="primary"
>
<Avatar alt="Travis Howard" src="/static/images/avatar/2.jpg" />
<Avatar
alt="Travis Howard, 2 unread messages"
src="/static/images/avatar/2.jpg"
/>
</Badge>
<Badge
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
badgeContent={<SmallAvatar alt="" src="/static/images/avatar/1.jpg" />}
>
<InsertDriveFileIcon
color="action"
fontSize="large"
titleAccess="Q4 budget spreadsheet, last edited by Remy Sharp"
/>
</Badge>
</Stack>
);
Expand Down
23 changes: 18 additions & 5 deletions docs/data/material/components/avatars/BadgeAvatars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { styled } from '@mui/material/styles';
import Badge from '@mui/material/Badge';
import Avatar from '@mui/material/Avatar';
import Stack from '@mui/material/Stack';
import InsertDriveFileIcon from '@mui/icons-material/InsertDriveFile';

const StyledBadge = styled(Badge)(({ theme }) => ({
'& .MuiBadge-badge': {
Expand Down Expand Up @@ -46,16 +47,28 @@ export default function BadgeAvatars() {
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
variant="dot"
>
<Avatar alt="Remy Sharp" src="/static/images/avatar/1.jpg" />
<Avatar alt="Remy Sharp, online" src="/static/images/avatar/1.jpg" />
</StyledBadge>
<Badge
overlap="circular"
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
badgeContent={
<SmallAvatar alt="Remy Sharp" src="/static/images/avatar/1.jpg" />
}
badgeContent={2}
color="primary"
>
<Avatar alt="Travis Howard" src="/static/images/avatar/2.jpg" />
<Avatar
alt="Travis Howard, 2 unread messages"
src="/static/images/avatar/2.jpg"
/>
</Badge>
<Badge
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
badgeContent={<SmallAvatar alt="" src="/static/images/avatar/1.jpg" />}
>
<InsertDriveFileIcon
color="action"
fontSize="large"
titleAccess="Q4 budget spreadsheet, last edited by Remy Sharp"
/>
</Badge>
</Stack>
);
Expand Down
16 changes: 0 additions & 16 deletions docs/data/material/components/avatars/BadgeAvatars.tsx.preview

This file was deleted.

23 changes: 0 additions & 23 deletions docs/data/material/components/badges/AccessibleBadges.js

This file was deleted.

23 changes: 0 additions & 23 deletions docs/data/material/components/badges/AccessibleBadges.tsx

This file was deleted.

This file was deleted.

132 changes: 74 additions & 58 deletions docs/data/material/components/badges/BadgeAlignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import FormLabel from '@mui/material/FormLabel';
import Radio from '@mui/material/Radio';
import RadioGroup from '@mui/material/RadioGroup';
import Box from '@mui/material/Box';
import IconButton from '@mui/material/IconButton';
import MailIcon from '@mui/icons-material/Mail';
import { HighlightedCode } from '@mui/internal-core-docs/HighlightedCode';

Expand All @@ -22,12 +23,18 @@ export default function BadgeAlignment() {
};

const jsx = `
<Badge
anchorOrigin={{
vertical: '${vertical}',
horizontal: '${horizontal}',
}}
>
<IconButton aria-label="show 12 unread messages">
<Badge
badgeContent={12}
color="secondary"
anchorOrigin={{
vertical: '${vertical}',
horizontal: '${horizontal}',
}}
>
<MailIcon />
</Badge>
</IconButton>
`;

return (
Expand Down Expand Up @@ -74,58 +81,67 @@ export default function BadgeAlignment() {
},
}}
>
<Badge
color="secondary"
variant="dot"
badgeContent={1}
anchorOrigin={{
horizontal,
vertical,
}}
>
<MailIcon />
</Badge>
<Badge
color="secondary"
badgeContent={1}
anchorOrigin={{
horizontal,
vertical,
}}
>
<MailIcon />
</Badge>
<Badge
color="secondary"
badgeContent={12}
anchorOrigin={{
horizontal,
vertical,
}}
>
<MailIcon />
</Badge>
<Badge
color="secondary"
badgeContent={123}
anchorOrigin={{
horizontal,
vertical,
}}
>
<MailIcon />
</Badge>
<Badge
color="secondary"
max={999}
badgeContent={1337}
anchorOrigin={{
horizontal,
vertical,
}}
>
<MailIcon />
</Badge>
<IconButton aria-label="show unread messages">
<Badge
color="secondary"
variant="dot"
anchorOrigin={{
horizontal,
vertical,
}}
>
<MailIcon />
</Badge>
</IconButton>
<IconButton aria-label="show 1 unread message">
<Badge
color="secondary"
badgeContent={1}
anchorOrigin={{
horizontal,
vertical,
}}
>
<MailIcon />
</Badge>
</IconButton>
<IconButton aria-label="show 12 unread messages">
<Badge
color="secondary"
badgeContent={12}
anchorOrigin={{
horizontal,
vertical,
}}
>
<MailIcon />
</Badge>
</IconButton>
<IconButton aria-label="show more than 99 unread messages">
<Badge
color="secondary"
badgeContent={123}
anchorOrigin={{
horizontal,
vertical,
}}
>
<MailIcon />
</Badge>
</IconButton>
<IconButton aria-label="show more than 999 unread messages">
<Badge
color="secondary"
max={999}
badgeContent={1337}
anchorOrigin={{
horizontal,
vertical,
}}
>
<MailIcon />
</Badge>
</IconButton>
</Box>
<HighlightedCode code={jsx} language="jsx" />
</Box>
Expand Down
Loading
Loading