Components/Switch

Search documentation

Jump to any guide or component.

↑↓ move · Enter open · Esc close

Forms · Switch

SSR NativeAccessible

Switch

Changes a setting immediately with a labelled binary control.

Live previewv0.1.4
Astro
---
import { Switch } from '@charvesta/cetha';
---

<Switch id="alerts" name="alerts" label="Critical alerts" checked />

API reference

PropTypeDefaultDescription
id*stringConnects the control and label.
label*stringVisible setting name.
descriptionstringOptional consequence or scope.
classstringAdditional classes forwarded to the rendered element.

Accessibility

Use a switch for immediate settings, not choices that require form submission.