Forms
Switch
An on/off switch over a native checkbox, so focus, keyboard, forms and screen readers come from the browser.
Preview
Installation
// Resolves dependencies, copies the source, and installs npm packages automatically.
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | ReactNode | - | Clickable label next to the switch |
| checked | boolean | - | Controlled state |
| defaultChecked | boolean | - | Uncontrolled starting state |
| disabled | boolean | false | Dims and disables |