Components › Forms

Switch

An on and off setting that applies immediately.

Installation

npx plankui@latest add switch

Usage

import { Switch } from "@/components/ui/switch";

<Switch id="wifi" defaultChecked />

API reference

PropTypeDefaultDescription
checked / defaultCheckedbooleanState.
onCheckedChange(checked: boolean) => voidCalled on toggle.
size"sm" | "md""md"Track size.

View the source on GitHub