Switch
Displays a switch built on the Base UI Switch primitive, for turning a setting on or off with an accessible label.
Installation
Bash
Usage
API reference
Switch
Extends the
Base UI Switch Root — all
its props apply: checked/defaultChecked, onCheckedChange,
name/value and uncheckedValue for form submission. The thumb is
built in.
| Prop | Type | Default |
|---|---|---|
size | "default" | "sm" | "default" |
checked / defaultChecked | boolean | false |
onCheckedChange | (checked: boolean) => void | — |
disabled | boolean | false |
name / value | string — form submission | — |