-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[docs][ToggleButtonGroup] Add spacing demo #46058
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
Conversation
Netlify deploy previewBundle size report |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sai6855 I believe we should wait for upvotes first. If there's enough demand, we should consider adding a spacing prop to ToggleButton, like in Joy UI.
Sure Till the time prop is added (which we don't know when) this demo https://deploy-preview-46058--material-ui.netlify.app/material-ui/react-toggle-button/#spacing helps users how to adjust spacing between buttons, Since the solution isn’t very straightforward and the use case is common, I believe it would be helpful to include this demo to guide users. |
How do we know that without getting requests? |
The Google Sheets and Slack examples are shown in the Customization section of the docs. The Gmail search filter and Swiggy examples are actually tabs styled as buttons, where clicking them displays the corresponding tab content. Like this? Also, the Customization demo already shows how to add spacing, doesn’t it? |
No, Both in Gmail search and swiggy examples users can select multiple filters, it's possible in ToggleButtons (https://mui.com/material-ui/react-toggle-button/#multiple-selection) not in Tabs. In Tabs users can't select multiple Tabs at once.
It only shows spacing when the orientation is horizontal. Adding spacing for vertical toggle buttons is still non-trivial, users need to check the source code to figure out how to override the styles correctly. So, adding a dedicated demo that covers spacing for both orientations helps a lot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, we can add this demo.
However, I believe we should have separate demos for horizontal and vertical orientations, rather than mixing both in one.
@ZeeshanTamboli Applied your suggestions, PR is ready for review now. preview: https://deploy-preview-46058--material-ui.netlify.app/material-ui/react-toggle-button/#spacing |
974689e
to
16cb8b2
Compare
@ZeeshanTamboli any idea why |
Let me take a look. |
0ff3f03
to
5d824ef
Compare
@ZeeshanTamboli After hours of debugging 😐 , turns out accessing theme directly is causing there several demos which do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
related to : #45569
I was hesitant to add
gap
prop, since this might be solved in future using css variable like how joy-ui is doing right now, so just added a demo nowpreview: https://deploy-preview-46058--material-ui.netlify.app/material-ui/react-toggle-button/#spacing