Switch, Checkbox, RadioGroup

Frond
Boolean and choice controls. Switch applies immediately; Checkbox waits for Save.

Usage

The import, then a use to start from. Both copy as they are.

Import
import { Checkbox } from "@/components/ui/checkbox";import { Label } from "@/components/ui/label";import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";import { Switch } from "@/components/ui/switch";
Example
<Switch checked={askFernEnabled} onCheckedChange={setAskFernEnabled} aria-label="Ask Fern" /> <RadioGroup value={layout} onValueChange={setLayout}>    <div className="flex items-center gap-2">        <RadioGroupItem value="stacked" id="layout-stacked" />        <Label htmlFor="layout-stacked">Stacked</Label>    </div>    <div className="flex items-center gap-2">        <RadioGroupItem value="side-by-side" id="layout-side-by-side" />        <Label htmlFor="layout-side-by-side">Side by side</Label>    </div></RadioGroup>

When to use

Use it for

  • Switch applies the moment it flips and confirms with a toast: for settings that take effect at once.
  • Checkbox belongs to a form that waits for Save, or selects rows in a table. It has an indeterminate state for “some”.
  • RadioGroup for one choice of 2 to 5 that should all stay in view.

Avoid

  • A Switch in a form with a Save button. People expect a switch to act on its own.
  • Two radio buttons for on and off: that's one Switch or Checkbox.
  • More than 5 options: use a Select.

Accessibility

Checks

  • Every control has a visible label tied to it, or an aria-label when the row's text names it.
  • Space toggles and the arrow keys move within a radio group; don't override them.

API

Read from each component's stories, the same source as COMPONENTS.md, and kept in step by check:design-system.

Switch

PropValues
disabledboolean
VariantsDefaultCheckedDisabledDisabledCheckedWithLabel

Checkbox

PropValues
disabledboolean
VariantsDefaultCheckedIndeterminateDisabledDisabledCheckedWithLabel

RadioGroup

Its stories don't declare argTypes, so no props are listed. The variants show its states.
Also exportsRadioGroupItem
VariantsDefaultWithDescriptionsDisabled

Keep going

Patterns
How components come together into pages.