Adding new component variants does not work as documented for all components #29455
Open
2 tasks done
Labels
new feature
New feature or request
The v5 documentation details how to create new variants for components. The example there with Button works great with TS because
@mui/material/Button
exportsButtonPropsVariantOverrides
.However, it seems that not all components follow this pattern - namely
@mui/material/Menu
and@mui/material/Select
. There are probably more, but these two do not export something along the lines ofSelectPropsVariantOverrides
- their variants are merely a string union. It would be great to achieve consistency in how new variants are added and typed across componentsCurrent Behavior 😯
There is no clear way to add new typed variants in TS for Select and Menu
Expected Behavior 🤔
It should work as well as it does with the Button component - I should be able to create new variants for MuiSelect in my theme file.
Steps to Reproduce 🕹
https://codesandbox.io/s/old-lake-ut7e1?file=/src/Demo.tsx
Context 🔦
I'm trying to create new variants for MuiSelect in my theme file.
Your Environment 🌎
`npx @mui/envinfo`
The text was updated successfully, but these errors were encountered: