mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-03 03:18:52 +00:00
Upstream sync from shadcn-ui/ui (1686 commits since last merge base). Key changes: - packages/shadcn upgraded to 4.1.0 (CLI font transformers, scaffold from github, chart colors) - apps/v4 replaces apps/www as the primary docs/registry app - Font system: 25+ heading font registries, font markers utility, @supports override - Chart improvements: recharts v3 compat, radial chart fixes - templates/ updated with monorepo variants (astro, vite, react-router, start) - skills/shadcn AI skill definitions added - deprecated/ removed (auth, auth-firebase, cli, www) Preserved Hanzo-only paths: app/, pkg/, demo/, docs/, template/next/
46 lines
1.7 KiB
TypeScript
46 lines
1.7 KiB
TypeScript
import { Label } from "@/registry/new-york-v4/ui/label"
|
|
import { Switch } from "@/registry/new-york-v4/ui/switch"
|
|
|
|
export function SwitchDemo() {
|
|
return (
|
|
<div className="flex flex-col gap-6">
|
|
{/* Sizes. */}
|
|
<div className="flex items-center gap-4">
|
|
<div className="flex items-center gap-2">
|
|
<Switch id="switch-demo-sm" size="sm" />
|
|
<Label htmlFor="switch-demo-sm">Small</Label>
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<Switch id="switch-demo-default" />
|
|
<Label htmlFor="switch-demo-default">Default</Label>
|
|
</div>
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<Switch id="switch-demo-airplane-mode" />
|
|
<Label htmlFor="switch-demo-airplane-mode">Airplane Mode</Label>
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<Switch
|
|
id="switch-demo-bluetooth"
|
|
className="data-[state=checked]:bg-blue-500 dark:data-[state=checked]:bg-blue-600"
|
|
defaultChecked
|
|
/>
|
|
<Label htmlFor="switch-demo-bluetooth">Bluetooth</Label>
|
|
</div>
|
|
<Label className="flex items-center gap-6 rounded-lg border p-4 has-[[data-state=checked]]:border-blue-600">
|
|
<div className="flex flex-col gap-1">
|
|
<div className="font-medium">Share across devices</div>
|
|
<div className="text-sm font-normal text-muted-foreground">
|
|
Focus is shared across devices, and turns off when you leave the
|
|
app.
|
|
</div>
|
|
</div>
|
|
<Switch
|
|
id="switch-demo-focus-mode"
|
|
className="data-[state=checked]:bg-blue-500 dark:data-[state=checked]:bg-blue-600"
|
|
/>
|
|
</Label>
|
|
</div>
|
|
)
|
|
}
|