-
-
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
Make component theme default props variant-aware #34812
Labels
Comments
Any updates on this ? this is also mandatory to override the svg icons used by an |
Would also love to see this. Is there currently any work around to archieve this? |
It would be really cool to have this feature! |
Dusting off the cobwebs 🕸️ 🧹 |
Bumping this! Would love to have this feature! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Duplicates
Latest version
Summary 💡
When passing component overrides to
createTheme()
, allow thevariants
objects for each component to define their own default props as a callback with theme as its argument (same asstyle
on the same object). This would mean that given a minimum set of required props for the component to qualify as a 'variant', we can assign any other default props for that variant.Examples 🌈
Motivation 🔦
I want to be able to define what the default props for a component should be given that it matches a specific variant which i have defined. Specifically, i want to define a default icon for the Autocomplete component whose size changes according to the
size
prop passed to the component. Without this ability, i am forced to use a default icon whose size won't intelligently match the Autocomplete depending on the size. Instead, i have to pass the icon as the appropriate size everywhere that i use the Autocomplete.The text was updated successfully, but these errors were encountered: