Open dungle-scrubs opened 3 years ago
I don't quite understand the issue.
I'd like to style a
<ToggleButton>
to look and behave exactly like a<Button>
without explicitly overriding all of theToggleButton
's class styles.
If you like it to behave like a Button, why don't you use the Button?
Is the use-case that you would like to actually use a ToggleButton that looks like Button? What about the toggled state?
It would partially be possible to do this once we have unstyled
version of this component, once we have it.
@mnajdova Thanks, sorry I forgot to clarify something. I'm using ToggleButton for radio-button-like functionality, but I need the radios to look exactly like <Button>
, including hover and active states.
I couldn't get Mui's <Radio>
to style like a <Button>
so I'm trying to use <ToggleButton>
instead. However, I get an error when using <Button>
inside of <ToggleButton>
.
Does that make sense?
Got it yes, sounds like something that will be possible with the unstyled
components. Until then, we don’t have option to reset styles.
Thanks for clearing that up and looking forward to that. Until then, manually restyling isn't too big of a deal.
This makes me think about:
I'd like to style a
<ToggleButton>
to look and behave exactly like a<Button>
without explicitly overriding all of theToggleButton
's class styles.I've learned that I can inject
Button
styles this way: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