-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[ButtonGroup][joy] Add ButtonGroup
component
#37407
Conversation
Netlify deploy preview@mui/joy: parsed: +1.15% , gzip: +0.84% Bundle size report |
Hey @siriwatknp and @danilo-leal, I started iterating this component with some styles from the default theme, and it'd be cool to have your inputs on the Figma file. What do you think? |
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.
While reviewing I noticed that the disabled solid buttons don't have enough contrast:
Navigating with keyboard and pressing enter is not opening the options:
Not related specifically for this PR, but should we make the focus indicator follow the color of the element it wraps? For e.g. using green color in this use-case:
/** Class name applied to the root element if `orientation="horizontal"`. */ | ||
horizontal: string; | ||
/** Class name applied to the root element if `orientation="vertical"`. */ | ||
vertical: string; |
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.
Do we have some kind of concensus on when we use the prop name as a prefix before the value? For e.g. why using sizeLg
, but not orientationHorizontal
?
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.
My only argument is that orientationHorizontal
is too long. It bloats the class name in the devtool, harder to debug.
However, no strong objection if we want to make it consistent.
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.
We can decide on it regardless of this PR. I would vote for consistency, so that they are predictable.
@mnajdova I made a few changes to this component, but is still on Figma, please tell me what you think 😊
In WCAG 2.2 there are many instructions on how to improve the focus accessibility, so I believe we definitely have room for improvement. However, I don't think changing the color would help. I'm afraid this would be confusing during the keyboard navigation in a page with many components of different colors, making it slightly harder to follow. |
Makes sense 👍 maybe we can consider using a grey color that would work nicely with all colors. It's just a thought, not tight to this PR in any way :) |
I think this should be fixed in another PR. It is related directly to the global variants, not specific to components. |
@zanivan just pushed the updated version according to the figma file. I notice that the divider of the ![]() |
Yep, definitely. I'll update it on the Figma file |
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.
It looks good, definitely improved the contrast!
I think It'll be even better when we finish polishing out the default theme 👀
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 great! Let's tackle the rest of the comments in a follow ups.
Preview: https://deploy-preview-37407--material-ui.netlify.app/joy-ui/react-button-group/
Improvements from Material UI
IconButton
as children