Inputs
Switch
A toggle switch — a native checkbox with role="switch" under the hood, so assistive tech announces it correctly while behaving like any controlled checkbox.
SwitchPreview
Usage
tsx
import { Switch } from "@vesture/react";
<Switch
label="Enable notifications"
checked={enabled}
onChange={(e) => setEnabled(e.target.checked)}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | ReactNode | — | Rendered after the visual track. |
| ...rest | Omit<InputHTMLAttributes<HTMLInputElement>, "type"> | — | Spread onto the hidden native input. |