Vesture
Get started

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.

Switch

Preview

Usage

tsx
import { Switch } from "@vesture/react";

<Switch
  label="Enable notifications"
  checked={enabled}
  onChange={(e) => setEnabled(e.target.checked)}
/>

Props

PropTypeDefaultDescription
labelReactNodeRendered after the visual track.
...restOmit<InputHTMLAttributes<HTMLInputElement>, "type">Spread onto the hidden native input.