Switch
Toggles a setting between on and off. Use it when the change takes effect immediately rather than waiting for form submission.
React
Ready
Figma
React examples
SwitchField
SwitchField adds the label and description, and makes the whole row the target.
import { Stack, SwitchField } from "@kela-systems/ui-components"; export default function SwitchFieldExample() { return ( <Stack gap={4} className="w-full max-w-sm"> <SwitchField defaultChecked label="Auto-track" description="Keep the camera on the selected track." /> <SwitchField label="Night mode" /> <SwitchField variant="box" placement="end" label="Geofence alerts" description="Alert when a track crosses the north fence." /> </Stack> ); }
Props
Switch
| Name | Default | Description |
|---|---|---|
size"sm" | "default" | "default" |
It also takes the props of Base UI's switch.
SwitchField
| Name | Default | Description |
|---|---|---|
size"sm" | "default" | "default" | |
variant"default" | "box" | "default" | |
placement"start" | "end" | "start" | |
labelRequiredReact.ReactNode | ||
descriptionReact.ReactNode |
It also takes the props of Base UI's switch.