{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "control-switch",
  "title": "Control switch",
  "description": "on or off in a panel row · the thumb’s side says which",
  "dependencies": [
    "cn@^0.5.2"
  ],
  "registryDependencies": [
    "@halftone-web/kit-setup"
  ],
  "files": [
    {
      "path": "components/controls/switch.tsx",
      "content": "'use client';\nimport { cn } from 'cn';\n\n/**\n * On or off, in a panel row. The thumb's side says which, not only the fill: off sits left on the input colour, on\n * sits right on the primary colour. Space or Enter toggles.\n */\nexport function ControlSwitch({ label, checked, onChange, id, className }: { label: string; checked: boolean; onChange: (checked: boolean) => void; id?: string; className?: string }) {\n  return (\n    <button\n      id={id}\n      type=\"button\"\n      role=\"switch\"\n      aria-checked={checked}\n      aria-label={id ? undefined : label}\n      onClick={() => onChange(!checked)}\n      className={cn(\n        'focus-visible:ring-ring/50 relative inline-flex h-5 w-9 shrink-0 items-center rounded-full p-0.5 outline-none focus-visible:ring-[3px]',\n        checked ? 'bg-primary' : 'bg-input',\n        className\n      )}>\n      <span aria-hidden className={cn('bg-card block size-4 rounded-full shadow-sm motion-safe:transition-transform motion-safe:spring-snappy', checked && 'translate-x-4')} />\n    </button>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/controls/switch.tsx"
    }
  ],
  "meta": {
    "exports": [
      "ControlSwitch"
    ],
    "api": "<ControlSwitch label checked onChange id? />"
  },
  "categories": [
    "controls"
  ],
  "type": "registry:component"
}