Skip to content
Forms

Switch

A setting that applies right away.

import { Switch } from "@flinbu/seed";

States and sizes

One email per change request.
import { Switch } from "@flinbu/seed";

<div className="flex flex-col gap-sm">
  <Switch label="Sync with Figma" defaultChecked />
  <Switch label="Email me when Pluto proposes a change" description="One email per change request." />
  <Switch size="sm" label="Small" />
  <Switch label="Disabled" disabled />
</div>

Use it for

  • Turning a feature on or off immediately.

Use something else for

  • Choices saved with a form: use Checkbox.

Props

PropTypeDefaultDescription
label, descriptionReactNodenoneText next to the switch.
checked / defaultCheckedbooleannoneControlled or initial state.
onCheckedChange(checked: boolean) => voidnoneCalled on change.
size'sm' | 'md''md'40 × 20 or 32 × 16 px.
disabledbooleannoneCan't be changed.

Accessibility

  • Built on Radix Switch: role switch, Space toggles.