Components
Switch
A toggle for a single on or off setting.
You might be looking for:
- Toggle
A pill that stays pressed — on/off as a chip.
- Checkbox
Check one or more options independently.
- Radio Group
Pick exactly one from a visible set.
Playground
<div className="flex items-center gap-2"> <Switch id="notify" /> <Label htmlFor="notify">Email notifications</Label></div>Usage
import { Label } from "@sophic/portal-ui/components/ui/label";
import { Switch } from "@sophic/portal-ui/components/ui/switch";<div className="flex items-center gap-2">
<Switch id="notify" checked={on} onCheckedChange={setOn} />
<Label htmlFor="notify">Email notifications</Label>
</div>Props
Switch also accepts every Radix Switch.Root prop (checked,
defaultChecked, onCheckedChange, disabled, ...).
Prop
Type
Default
Changelog
- 21 November 2026 —
md(24px) is the default size;sm(20px) is the dense variant. Full notes - 21 November 2026 — Off track uses
--field, the Segmented Control track, in light and dark. Full notes - 13 October 2026 — Off track reads
--switch-unchecked, a visible step above the dark card and dialog surfaces. Full notes - 19 August 2026 — “You might be looking for” map to Checkbox and Radio Group. Full notes
- 18 August 2026 — Docs page added (was in the library undocumented). Full notes
- 18 August 2026 — Styles live in a CSS module; look unchanged. Full notes