Switch
Forms

Switch.

Accessible animated on/off control.

Real interactive component
Live demo

The preview uses the actual shared component, including your current theme, rounding, border and motion preferences.

Props & API reference

Parameters available in the shared component, including value types, requirements and accepted options.

5 props
ParameterTypeRequiredDefaultPossible valuesDescription
checkedbooleanNo—true · falseControlled enabled/disabled state.
defaultCheckedbooleanNofalsetrue · falseInitial uncontrolled state.
disabledbooleanNofalsetrue · falseDisable interaction.
onChangeChangeEventHandler<HTMLInputElement>No——Called when toggled.
aria-labelstringNo——Accessible switch name.