MaterialButton style does not support only Icon
See original GitHub issueWith the use of style Widget.MaterialComponents.Button.Icon
I was expecting the layout to format according to icon only but it works just like Widget.MaterialComponents.Button.TextButton.Icon
with requirement of adding text also along with icon.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:19
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Material Button Icon is showing without color - Stack Overflow
The app:icon is tinted with the app:iconTint color provided by the style by default ( Widget.MaterialComponents.Button.UnelevatedButton.
Read more >MaterialButton - Android Developers
The ".Icon" styles adjust padding slightly to achieve a better visual balance. This style should only be used with a start-aligned icon button....
Read more >@material/button - npm
MDC Web currently does not support toggle button groups. Icon. Icons can be used as toggle buttons when they allow selection, or deselection,...
Read more >React Button component - Material UI - MUI
Buttons allow users to take actions, and make choices, with a single tap. Buttons communicate actions that users can take. They are typically...
Read more >Common buttons – Material Design 3
Icons and labels now share the same color. Icons: Standard size for leading and trailing icons is now 18dp; Shape: Fully rounded corner...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, are you talking about the icon only buttons in the catalog demo? Yes that was a somewhat contentious decision but the reason we have two styles named like that is because the spec defines different paddings for buttons with and without icons. https://material.io/design/components/buttons.html
We don’t provide a style at the moment for Icon Only but you can easily create your own:
eg:
I’ve found it more useful:
I reset
minWidth
to make button square, setrippleColor
to show click effect and usemtrl_btn_text_color_selector
asiconTint
to add disabled state (got from here).You can set
cornerRadius
tolayout_width/2
and finally get this result: