[joy-ui] Make the size prop breakpoint-aware #41402
Labels
new feature
New feature or request
package: joy-ui
Specific to @mui/joy
waiting for 👍
Waiting for upvotes
Summary
Take a look at this code snippet:
If you want to change the size prop on certain screen sizes with Material UI, you can use hooks:
Often it might be too complicated for a simple task. However, it helps us reuse the predefined settings in Material UI's design system. The size prop not only changes the font size but could also affects other properties like margin, padding, height, and width etc ...
With Joy UI, we have to redefine each property separately, which can lead to inconsistencies:
It would be better to stay within the design system and respect the predefined settings that were already set up.
One suggestion is to add support for props to handle breakpoint changes, similar to how
ButtonGroup
already supports this:This approach would allow you to write something like:
This way, we can easily change the size prop based on different screen sizes while still using the predefined settings in the design system.
Examples
No response
Motivation
No response
Search keywords: breakpoint
The text was updated successfully, but these errors were encountered: