You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Customize theme with components => MuiSelect => styleOverrides
Define a variant for root and icon slots, both with props: props: { size: 'small' }
Current behavior
Variant for root is recognized and applied, for icon - it's not
Expected behavior
As far as I understand, also a variant for a slot should work.
Context
I tried for the icon a hardcoded props evaluation:
props: ()=>true
and it works. I also debugged size prop evaluation with:
props: ({ size })=>console.log(size)
and initially it has correct value small but immediately during next evaluation it's undefined What's surprising for me, it behaves exactly the same for root, but doesn't break variant's styling for root 🤔
I have reviewed this issue and was able to reproduce the behavior locally—variants defined for non-root slots (such as icon) do not appear to be applied as expected.
Before proceeding with a potential fix, I wanted to ask whether supporting slot-based variants is something the team would consider appropriate. Alternatively, should developers rely on styleOverrides for this type of customization?
I have the repository set up locally and would be happy to contribute a fix or documentation update, depending on the intended direction. Please let me know what you think.
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
@twawszczak Thanks again for creating this issue! If you have a moment, we would love to hear your thoughts on how we handled it with this short feedback form.
Activity
siriwatknp commentedon Nov 18, 2024
Thanks for reporting the issue. I will take a look.
iamAfrontendDev commentedon Sep 3, 2025
Hello @siriwatknp
I have reviewed this issue and was able to reproduce the behavior locally—
variantsdefined for non-root slots (such asicon) do not appear to be applied as expected.Before proceeding with a potential fix, I wanted to ask whether supporting slot-based variants is something the team would consider appropriate. Alternatively, should developers rely on
styleOverridesfor this type of customization?I have the repository set up locally and would be happy to contribute a fix or documentation update, depending on the intended direction. Please let me know what you think.
Thank you.
[system] Apply theme variants to all slots by default
github-actions commentedon Nov 20, 2026
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
@twawszczak Thanks again for creating this issue! If you have a moment, we would love to hear your thoughts on how we handled it with this short feedback form.