Forms
Switch
stableInstant on/off setting, typically in settings lists.
since v1.11.2 kB gzip
Preview
Installation
npx @strata/cli add switchUsage
import { Switch } from "@/components/strata";
<Switch defaultSelected>Enable preview deployments</Switch>Props
| Prop | Type | Default |
|---|---|---|
isSelectedControlled state. | boolean | — |
sizeTrack size. | "sm" | "md" | "lg" | "md" |
labelPlacementPut the label before the switch. | "end" | "start" | "end" |
isDisabledPrevents interaction and dims the control. | boolean | false |
Accessibility
Related
Text field
Single-line input with label, description, validation and adornments.
Select
Pick one option from a list, with typeahead and sections.
Checkbox
Binary choice with indeterminate state and grouped variants.
Slider
Choose a value or range along a track, with steps and output.
Was this page helpful?
Documented since v1.1 · components/switch.mdx