{"$schema":"https://ui.logic2b.com/schema/registry-item.json","name":"switch","type":"registry:ui","description":"A control that toggles between checked and unchecked states, presented as a physical switch. Use for on/off settings, built on Radix Switch.","dependencies":["radix-ui"],"registryDependencies":["utils"],"files":[{"path":"ui/switch.tsx","type":"registry:ui","content":"\"use client\"\n\nimport * as React from \"react\"\nimport { Switch as SwitchPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Switch({\n  className,\n  ...props\n}: React.ComponentProps<typeof SwitchPrimitive.Root>) {\n  return (\n    <SwitchPrimitive.Root\n      data-slot=\"switch\"\n      className={cn(\n        \"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=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      <SwitchPrimitive.Thumb\n        data-slot=\"switch-thumb\"\n        className={cn(\n          \"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0\"\n        )}\n      />\n    </SwitchPrimitive.Root>\n  )\n}\n\nexport { Switch }\n"}],"categories":["form"],"accessibility":{"support":"primitive","pattern":"switch","primitive":"Radix Switch","keyboard":[{"keys":["Enter","Space"],"action":"Activate the focused control."}],"aria":["Exposes role=switch and aria-checked."],"consumer":["Associate it with a label that describes the setting, not only the current state."]},"api":{"source":"src/ui/switch.tsx","exports":[{"name":"Switch","kind":"component","propsType":"React.ComponentProps<typeof SwitchPrimitive.Root>"}]}}