-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[material-ui][AvatarGroup] Add
renderSurplus
prop (#39283)
- Loading branch information
Showing
10 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
docs/data/material/components/avatars/CustomSurplusAvatars.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as React from 'react'; | ||
import Avatar from '@mui/material/Avatar'; | ||
import AvatarGroup from '@mui/material/AvatarGroup'; | ||
|
||
export default function CustomSurplusAvatars() { | ||
return ( | ||
<AvatarGroup | ||
renderSurplus={(surplus) => <span>+{surplus.toString()[0]}k</span>} | ||
total={4251} | ||
> | ||
<Avatar alt="Remy Sharp" src="/static/images/avatar/1.jpg" /> | ||
<Avatar alt="Travis Howard" src="/static/images/avatar/2.jpg" /> | ||
<Avatar alt="Agnes Walker" src="/static/images/avatar/4.jpg" /> | ||
<Avatar alt="Trevor Henderson" src="/static/images/avatar/5.jpg" /> | ||
</AvatarGroup> | ||
); | ||
} |
17 changes: 17 additions & 0 deletions
17
docs/data/material/components/avatars/CustomSurplusAvatars.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as React from 'react'; | ||
import Avatar from '@mui/material/Avatar'; | ||
import AvatarGroup from '@mui/material/AvatarGroup'; | ||
|
||
export default function CustomSurplusAvatars() { | ||
return ( | ||
<AvatarGroup | ||
renderSurplus={(surplus) => <span>+{surplus.toString()[0]}k</span>} | ||
total={4251} | ||
> | ||
<Avatar alt="Remy Sharp" src="/static/images/avatar/1.jpg" /> | ||
<Avatar alt="Travis Howard" src="/static/images/avatar/2.jpg" /> | ||
<Avatar alt="Agnes Walker" src="/static/images/avatar/4.jpg" /> | ||
<Avatar alt="Trevor Henderson" src="/static/images/avatar/5.jpg" /> | ||
</AvatarGroup> | ||
); | ||
} |
9 changes: 9 additions & 0 deletions
9
docs/data/material/components/avatars/CustomSurplusAvatars.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<AvatarGroup | ||
renderSurplus={(surplus) => <span>+{surplus.toString()[0]}k</span>} | ||
total={4251} | ||
> | ||
<Avatar alt="Remy Sharp" src="/static/images/avatar/1.jpg" /> | ||
<Avatar alt="Travis Howard" src="/static/images/avatar/2.jpg" /> | ||
<Avatar alt="Agnes Walker" src="/static/images/avatar/4.jpg" /> | ||
<Avatar alt="Trevor Henderson" src="/static/images/avatar/5.jpg" /> | ||
</AvatarGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters