Skip to content
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

[Checkbox][Radio] Custom icon size #19290

Closed
1 task done
rostislavbobo opened this issue Jan 19, 2020 · 4 comments
Closed
1 task done

[Checkbox][Radio] Custom icon size #19290

rostislavbobo opened this issue Jan 19, 2020 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@rostislavbobo
Copy link
Contributor

rostislavbobo commented Jan 19, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

The [Radio][Checkbox] Add size="small" support has been recently released, which conditionally sets icon fontSize allowing it to have only 'small' or 'default' values without providing any ability to customize it.

It'd be really nice to have the ability to provide a custom fontSize prop to the rendering icons, that will be applied no matter what value contains the size prop

Examples 🌈

We could either allow to specify a custom fontSize while providing an icon

<Checkbox
  icon={<AddCircleOutlinedIcon fontSize="large" />}
  checkedIcon={<CheckIcon fontSize="large" />}
/>

or by adding an extra IconProps prop to [Checkbox] and [Radio] components that will be spreaded over

<Checkbox
  icon={<AddCircleOutlinedIcon />}
  checkedIcon={<CheckIcon />}
  IconProps={{ fontSize: 'large' }}
/>

Motivation 🔦

We all treat Material-UI library as a flexible and extendable tool we could use to build almost every design. Fixing or hardcoding props inside components without providing the way to override a standard behavior is not about this library

@rostislavbobo
Copy link
Contributor Author

Personally speaking, I prefer the first option, because it provides more flexibility by allowing to specify each case independently, for example

<Checkbox
  icon={<AddCircleOutlinedIcon fontSize="small" />}
  indeterminateIcon={<RemoveIcon />}
  checkedIcon={<CheckIcon fontSize="large" />}
/>

Before I start the implementation, want to be on the same page with the community
Any comments are highly welcomed

@oliviertassinari oliviertassinari added the duplicate This issue or pull request already exists label Jan 19, 2020
@rostislavbobo
Copy link
Contributor Author

@oliviertassinari , really sorry to disturb you, but I can't find what issue it duplicates. Would appreciate if you could specify that one, thanks in advance

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 19, 2020

It's the one related to the support of dynamic and arbitrary props. We link it in the Roadmap. Sorry, I won't have the time to find it.

@rostislavbobo
Copy link
Contributor Author

rostislavbobo commented Jan 19, 2020

Even though I can see what you're talking about, I can't find it in the Roadmap either.

Anyway, I'm offering to fix the lack of flexibility that was recently introduced by adding new functionality, which forces me to add some kludges. The fix won't take much and will bring back the flexibility we had without breaking changes.

If you still think it's better to postpone it, will not object any longer.

Sorry for disturbing you and thank you for your time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants