-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Joy] Refine componentsProps
for all components
#34077
Conversation
@mui/joy: parsed: +0.34% , gzip: -0.16% 😍 |
@@ -49,13 +49,15 @@ export default function ExampleChoiceChipCheckbox() { | |||
setValue((val) => val.filter((text) => text !== item)); | |||
} | |||
}} | |||
sx={{ |
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 improving the support for componentsProps
in all the Joy UI components sounds great, for adding custom attributes, and events. I wonder if using it for customization over the CSS selectors is a step forward. Personally, I found the previous approach better. We teach for customizations that are not one-off to use the styled()
API, which was easier to migrate to with the sx
demo.
Another way to look at it, SASS is still the most popular way to style: https://2021.stateofcss.com/en-US/technologies/#scatterplot_overview. How would somebody using SASS would figure out how to migrate the customization?
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.
I think this is not up to Joy and I don't even think which one is better. It's all up to the developers to choose the way they prefer. I will ensure that both ways are documented.
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's all up to the developers to choose the way they prefer.
@siriwatknp It's an interesting perspective. I had tried this path in the past (my initial intuition of how it should be done) and stopped once I saw too many developers struggling with deciding which option they should use. I saw them ask for the documentation to give them "the way". For example, in our last developer survey: https://www.notion.so/mui-org/Raw-data-aa374141dcb3453dbfea301dcc437126#8830e74c200946dcb29ce385684f1dc4
10 | more opinionated
2 | less opinionated
Maybe it would make sense to first decide on which approach is better, and then stick to it everywhere in the docs 😁
a continuation of #34022 which apply to all components in this PR.
componentsProps
which can be a callback.{Component}OwnerState
types to be used instyleOverrides
.describeConformance