[ToggleButton] Provide unstyled/headless API for heavy customization
See original GitHub issueI’d like to style a <ToggleButton>
to look and behave exactly like a <Button>
without explicitly overriding all of the ToggleButton
’s class styles.
I’ve learned that I can inject Button
styles this way:
<ToggleButton
classes={{
root: 'MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedSecondary MuiButton-disableElevation',
selected: 'MuiButton-root:hover MuiButton-containedSecondary:hover MuiButton-disableElevation:active MuiButton-disableElevation:hover MuiButton-contained:active MuiButton-contained:hover',
}}
>
This halfway solves my problem. However, I’d like to avoid injecting the classes MuiToggleButton-root MuiToggleButtonGroup-grouped MuiToggleButtonGroup-groupedHorizontal
because they’re overriding the ones I’ve added above.
Is this sort of thing possible? The reason I’m trying this is because I can’t put a <Button>
inside of a <ToggleButton>
without getting an error, so I figured I’d try to make it look and behave like a <Button>
.
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[ToggleButton] Provide unstyled/headless API for ... - GitHub
I'd like to style a to look and behave exactly like a without explicitly overriding all of the ToggleButton's class styles.
Read more >Toggle Buttons - Android Developers
A toggle button allows the user to change a setting between two states. You can add a basic toggle button to your layout...
Read more >Blazor ToggleButton Overview - Documentation - Telerik
The Toggle Button provides several parameters that control its styling and appearance, including background color, shape, rounded corners and fill.
Read more >Mui pagination. jsx Framework css. Features Supports rtl, you ...
The MUI TablePagination component is a dynamic and highly customizable component. ... [ToggleButton] Provide unstyled/headless API for heavy customization ...
Read more >ToggleButton API - Material UI - MUI
The name MuiToggleButton can be used when providing default props or style overrides in the theme. Props. Props of the ButtonBase component are...
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
This makes me think about:
Got it yes, sounds like something that will be possible with the
unstyled
components. Until then, we don’t have option to reset styles.