[material] Add `variant` prop type in all components
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
Creating a List component variant causes TypeScript errors when using the variant prop in the variants declaration or at the component usage site.
Suppressing the TypeScript errors allows the variant to be declared and used as expected.
Expected behavior 🤔
Creating a List component variant is supported in TypeScript.
ListProps should have a declaration for variant, like we have in ButtonProps:
/**
* The variant to use.
* @default 'text'
*/
variant?: OverridableStringUnion<
'text' | 'outlined' | 'contained',
ButtonPropsVariantOverrides
>;
Steps to reproduce 🕹
Steps:
- Create a component variant for List using TypeScript.
Context 🔦
We're maintaining a UI library built on top of MUI, and we want to provide a "bordered" List variant for our users. This is is blocking us from doing that.
Your environment 🌎
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ListProps declaration and compare it with the ButtonProps variant typing shown in the issue. Reproduce the TypeScript errors using the linked CodeSandbox, then verify that component variants can be declared and used without errors across the affected components.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100