Switch
Render a labeled switch with controlled or uncontrolled checked state.
Props
Switch extends ButtonHTMLAttributes<HTMLButtonElement>. Renders as role="switch" with aria-checked.
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | On/off state. |
onChange | (checked: boolean) => void | — | Toggle handler. |
disabled | boolean | — | Prevents interaction. |
Examples
On / off
Interactive
Disabled
import { Switch } from "@solarius/onset";
import type { SwitchProps } from "@solarius/onset";