Switch

An on/off toggle control built on Radix Switch. Perfect for boolean settings.

Import

import { Switch } from "poyraz-ui/atoms";

Default

Basic switch with label.

<div className="flex items-center gap-3">
  <Switch id="airplane" />
  <Label htmlFor="airplane">Airplane Mode</Label>
</div>

Checked by Default

<Switch id="notifications" defaultChecked />

Disabled

<Switch disabled />
<Switch disabled defaultChecked />
pnpm dlx shadcn@latest add @poyraz/switch

Runtime dependencies

@radix-ui/react-switch@^1.2.6

Registry dependencies

@poyraz/poyraz-utils, @poyraz/poyraz-theme

Installed files

@ui/atoms/switch.tsx