Skip to content

IconButton misses "contained" variant #37443

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

Closed
2 tasks done
ronnyroeller opened this issue May 29, 2023 · 2 comments
Closed
2 tasks done

IconButton misses "contained" variant #37443

ronnyroeller opened this issue May 29, 2023 · 2 comments
Assignees
Labels
component: icon button This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it

Comments

@ronnyroeller
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 💡

Material Design specifies that IconButtons have a standard and a contained variant (docs):
image

Yet, the MUI IconButton doesn't have a variant prop to switch between them.

Note: It's NOT possible to just add the variant ourselves as a workaround (#35456)

Examples 🌈

https://m3.material.io/components/icon-buttons/overview

Motivation 🔦

We want to have contained IconButtons to make them stand up from stand IconButtons.

@ronnyroeller ronnyroeller added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 29, 2023
@DiegoAndai DiegoAndai self-assigned this May 29, 2023
@DiegoAndai
Copy link
Member

DiegoAndai commented May 29, 2023

Hey @ronnyroeller, thanks for the report 😃!

The documentation you provided is for Material Design 3 (MD3). MD3 is not supported at this time, but it's being actively worked on (see #29345 and #34738). MUI's Material UI package currently supports Material Design 2, and that's why this variant is not implemented.

Until MD3's IconButton implementation is done, I can suggest the workaround of implementing the "contained" variants in your codebase, here's a Condsandbox proof of concept of this workaround: https://codesandbox.io/s/icon-button-customization-utpu2p?file=/demo.tsx. This example uses the sx prop, here's the sx prop documentation.

Let me know if I can help with anything else 😊

@DiegoAndai DiegoAndai added component: icon button This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 29, 2023
@ronnyroeller
Copy link
Author

Thanks a lot, @DiegoAndai . Very clear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: icon button This is the name of the generic UI component, not the React module! status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it
Projects
None yet
Development

No branches or pull requests

2 participants