Toggle
A form component to use for enabling or disabling something
Default
What you get out of the box:
Editable example
Best practices
- Use a Toggle for turning a single option on or off
- Use a ToggleGroup for turning multiple related options on or off
- Use a RadioButtonGroup instead of a Toggle where only one option can be selected from a list
Disabled
To prevent modifications to the toggle state, set the disabled
prop to true.
Editable example
Dark theme
Editable example
Accessibility
- Always provide a meaningful
label
. If you need to visually hide the label, use thelabelHidden
prop. Screen readers will still read the hidden label when the toggle is focused.