Components / Switch

Forms

Switch

stable

Instant on/off setting, typically in settings lists.

since v1.11.2 kB gzip

Preview

Installation

npx @strata/cli add switch

Usage

import { Switch } from "@/components/strata";

<Switch defaultSelected>Enable preview deployments</Switch>

Props

PropTypeDefault
isSelected

Controlled state.

boolean—
size

Track size.

"sm" | "md" | "lg""md"
labelPlacement

Put the label before the switch.

"end" | "start""end"
isDisabled

Prevents interaction and dims the control.

booleanfalse

Accessibility

Was this page helpful?

Documented since v1.1 · components/switch.mdx