Switch
Tactile toggle switch with accessible role="switch" semantics and optional label/description pairing.
Interactive Playground
Tactile toggle switch with subtle violet glow when active.
switch-playground.tsx
Size
Sizes & Descriptions
Pair switches with labels and helper descriptions for clean settings panels.
switch-sizes.tsx
Quick Import
Example.tsxtsx
1import { Switch } from "@rekodo/react";2
3export function Example() {4 return <Switch defaultChecked label="Mechanical Tonearm" />;5}API Reference
Props accepted by this component.
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | undefined | Controlled checked state. |
| defaultChecked | boolean | false | Initial uncontrolled checked state. |
| onCheckedChange | (checked: boolean) => void | undefined | Called when toggled. |
| size | "sm" | "default" | "lg" | "default" | Switch track and thumb dimensions. |
| label / description | string | undefined | Optional accessible label and helper text. |