Skip to content
Dumb UI

Search Dumb UI

Jump to a page or component, or switch the style

Search Dumb UI

Jump to a page or component, or switch the style

Switch

Instant on/off. Raw snaps a square block, Silk stretches a soft pill, Volume slides a 3D knob along a raised track.

FormsRadix SwitchDumb extras
Props
$ pnpm dlx shadcn@latest add @dumb/switch

Needs the @dumb registry in components.json and the style tokens. See Installation.

import { Switch } from "@/components/ui/switch"
<Switch id="previews" />

Settings list

Rows of switches with descriptions, plus the sm size.

Email the commit author when a build fails.

Notify me when someone comments on a preview.

Warn at 80% of the monthly build minutes.

API reference

Props marked “extra” are Dumb UI additions. Everything else matches shadcn/ui.

Switch

PropTypeDefault
sizeextra"default" | "sm"

Scales the style's switch geometry by 0.78.

"default"
checked / defaultCheckedboolean

Controlled or initial state.

-
onCheckedChange(checked: boolean) => void

Called on change.

-
SpaceEnter
Toggles the switch.