material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Switch] Support overlay on `Switch` component

Open Studio384 opened this issue 3 years ago • 3 comments

Duplicates

  • [X] I have searched the existing issues

Latest version

  • [X] I have tested the latest version

Summary 💡

Provide support for the overlay prop in the Switch component, similar to how it is for the Checkbox and Radio components.

Examples 🌈

n/a

Motivation 🔦

Putting a switch inside a card with its description is a common UI, making the card entirely clickable to toggle the switch would make toggling it easier.

Studio384 avatar Dec 14 '22 15:12 Studio384

I assume that you are talking about Joy UI Switch. Could you please share a CodeSandbox that I can take a look?

siriwatknp avatar Dec 15 '22 07:12 siriwatknp

Yes, I was talking about the Joy component. I'm note sure what a CodeSandbox is needed for though, since its just the design pattern shown in the docs but with a switch instead of a checkbox.

Studio384 avatar Dec 15 '22 07:12 Studio384

Yes, I was talking about the Joy component. I'm note sure what a CodeSandbox is needed for though, since its just the design pattern shown in the docs but with a switch instead of a checkbox.

The CodeSandbox would help me understand what kind of user interface you are building so that I might add it to the docs as an example for the switch overlay. It could benefit others who are looking for a similar thing.

siriwatknp avatar Dec 15 '22 14:12 siriwatknp

@siriwatknp here is the use case my team has run into while using mui/joy.

image

keeganteetaert avatar Nov 15 '23 14:11 keeganteetaert