Form Inputs
Switch
A switch allows a user to turn a setting on or off.
A switch allows a user to turn a setting on or off.
Disabled#
Component props#
| Name | Type | Description |
|---|---|---|
| label | string | Label text rendered next to the switch (children works the same way) |
| size | 'sm' | 'md' | Track size (default: "md") |
| isSelected | boolean | Controlled selected state |
| defaultSelected | boolean | Default selected state |
| isDisabled | boolean | Disables the switch |
| onChange | (isSelected: boolean) => void | Called when state changes |
| value | string | boolean | A string is forwarded to the form input as the submitted value. A boolean is a deprecated alias for isSelected — prefer isSelected. |
