{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "switch",
  "type": "registry:ui",
  "title": "Switch",
  "description": "A control that allows the user to toggle between checked and not checked.",
  "dependencies": [
    "@base-ui/react"
  ],
  "files": [
    {
      "path": "src/registry/components/ui/switch.tsx",
      "content": "import * as React from \"react\";\nimport { Switch as SwitchPrimitive } from \"@base-ui/react/switch\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Switch({ className, children, ...props }: SwitchPrimitive.Root.Props) {\n  return (\n    <SwitchPrimitive.Root\n      data-slot=\"switch\"\n      className={cn(\n        \"peer data-[checked]:bg-primary data-[unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n        className\n      )}\n      {...props}\n    >\n      {children ?? <SwitchThumb />}\n    </SwitchPrimitive.Root>\n  );\n}\n\nfunction SwitchThumb({ className, ...props }: SwitchPrimitive.Thumb.Props) {\n  return (\n    <SwitchPrimitive.Thumb\n      data-slot=\"switch-thumb\"\n      className={cn(\n        \"bg-background dark:data-[unchecked]:bg-foreground dark:data-[checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[checked]:translate-x-[calc(100%-2px)] data-[unchecked]:translate-x-0\",\n        className\n      )}\n      {...props}\n    />\n  );\n}\n\nexport { Switch, SwitchThumb };\n",
      "type": "registry:ui"
    }
  ]
}