{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "switch",
  "title": "Switch",
  "description": "settings on/off",
  "dependencies": [
    "@rn-primitives/switch@^1.5.2"
  ],
  "registryDependencies": [
    "@kit-native/label",
    "@kit-native/lib-utils"
  ],
  "files": [
    {
      "path": "components/ui/switch.tsx",
      "content": "import { labelIdFor } from '@/components/ui/label';\nimport { cn } from '@/lib/utils';\nimport * as SwitchPrimitives from '@rn-primitives/switch';\nimport { Platform } from 'react-native';\n\nfunction Switch({\n  className,\n  ...props\n}: React.ComponentProps<typeof SwitchPrimitives.Root>) {\n  return (\n    <SwitchPrimitives.Root\n      className={cn(\n        'flex h-8 w-16 shrink-0 flex-row items-center rounded-full border border-transparent p-px shadow-sm',\n        Platform.select({\n          web: 'focus-visible:border-ring focus-visible:ring-ring/50 peer inline-flex outline-none transition-all focus-visible:ring-[3px] disabled:cursor-not-allowed',\n        }),\n        props.checked ? 'bg-primary' : 'bg-input dark:bg-input/80',\n        props.disabled && 'opacity-50',\n        className\n      )}\n      // On web the switch is a div, which `<Label htmlFor>` cannot label; point at the Label's id instead.\n      aria-labelledby={props.id ? labelIdFor(props.id) : undefined}\n      {...props}>\n      <SwitchPrimitives.Thumb\n        className={cn(\n          'bg-card size-7 rounded-full shadow-sm shadow-black/20 transition-transform',\n          Platform.select({\n            web: 'pointer-events-none block ring-0',\n          }),\n          props.checked\n            ? 'dark:bg-foreground translate-x-[32px]'\n            : 'dark:bg-foreground translate-x-0'\n        )}\n      />\n    </SwitchPrimitives.Root>\n  );\n}\n\nexport { Switch };\n",
      "type": "registry:ui",
      "target": "components/ui/switch.tsx"
    }
  ],
  "meta": {
    "exports": [
      "Switch"
    ],
    "api": "<Switch checked onCheckedChange />"
  },
  "docs": "Run `npx expo install --fix` afterwards so Expo SDK packages match your SDK. Needs the kit theme (`@kit-native/theme`) and `KitThemeProvider` from `@kit-native/lib-theme-context` at the root.",
  "categories": [
    "inputs"
  ],
  "type": "registry:ui"
}