Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui][AvatarGroup] Add renderSurplus prop #39283

Merged
merged 9 commits into from
Oct 11, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
revise docs
  • Loading branch information
uuxxx committed Oct 10, 2023

Verified

This commit was signed with the committer’s verified signature.
hawkw Eliza Weisman
commit d90edf3e4e0d4f0440d6e6b88ad3a03716905dd4
4 changes: 2 additions & 2 deletions docs/data/material/components/avatars/avatars.md
Original file line number Diff line number Diff line change
@@ -70,9 +70,9 @@ If you need to control the total number of avatars not shown, you can use the `t

### Custom surplus

Set `renderSurplus` prop as a callback to customize the surplus avatar. The callback will receive one argument which is the number of surpluses based on the children and `max` prop.
Set the `renderSurplus` prop as a callback to customize the surplus avatar. The callback will receive the surplus number as an argument based on the children and the `max` prop.
DiegoAndai marked this conversation as resolved.
Show resolved Hide resolved

This is useful when you need to render the surplus based on the data sent from the server.
The `renderSurplus` prop is useful when you need to render the surplus based on the data sent from the server.

{{"demo": "CustomSurplusAvatars.js"}}

4 changes: 2 additions & 2 deletions docs/pages/material-ui/api/avatar-group.json
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@
"renderSurplus": {
"type": { "name": "func" },
"signature": {
"type": "function(surplus: number) => React.ReactElement",
"type": "function(surplus: number) => React.ReactNode",
"describedArgs": ["surplus"],
"returned": "React.ReactElement"
"returned": "React.ReactNode"
}
},
"slotProps": {
2 changes: 1 addition & 1 deletion docs/translations/api-docs/avatar-group/avatar-group.json
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
"description": "custom renderer of extraAvatars",
"typeDescriptions": {
"surplus": "number of extra avatars",
"React.ReactElement": "custom element to display"
"React.ReactNode": "custom element to display"
}
},
"slotProps": {