{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "components-base-switch",
  "title": "Switch",
  "description": "A control that indicates whether a setting is on or off.",
  "registryDependencies": [
    "@animate-ui/primitives-base-switch"
  ],
  "files": [
    {
      "path": "registry/components/base/switch/index.tsx",
      "content": "import * as React from 'react';\n\nimport {\n  Switch as SwitchPrimitive,\n  SwitchThumb as SwitchThumbPrimitive,\n  SwitchIcon as SwitchIconPrimitive,\n  type SwitchProps as SwitchPrimitiveProps,\n} from '@/components/animate-ui/primitives/base/switch';\nimport { cn } from '@/lib/utils';\n\ntype SwitchProps = SwitchPrimitiveProps & {\n  pressedWidth?: number;\n  startIcon?: React.ReactElement;\n  endIcon?: React.ReactElement;\n  thumbIcon?: React.ReactElement;\n};\n\nfunction Switch({\n  className,\n  pressedWidth = 19,\n  startIcon,\n  endIcon,\n  thumbIcon,\n  ...props\n}: SwitchProps) {\n  return (\n    <SwitchPrimitive\n      className={cn(\n        'relative peer focus-visible:border-ring focus-visible:ring-ring/50 flex h-5 w-8 px-px shrink-0 items-center justify-start rounded-full border border-transparent shadow-xs outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n        'data-[checked]:bg-primary data-[unchecked]:bg-input dark:data-[unchecked]:bg-input/80 data-[checked]:justify-end',\n        className,\n      )}\n      {...props}\n    >\n      <SwitchThumbPrimitive\n        className={cn(\n          'relative z-10 bg-background dark:data-[unchecked]:bg-foreground dark:data-[checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0',\n        )}\n        pressedAnimation={{ width: pressedWidth }}\n      >\n        {thumbIcon && (\n          <SwitchIconPrimitive\n            position=\"thumb\"\n            className=\"absolute [&_svg]:size-[9px] left-1/2 top-1/2 -translate-1/2 dark:text-neutral-500 text-neutral-400\"\n          >\n            {thumbIcon}\n          </SwitchIconPrimitive>\n        )}\n      </SwitchThumbPrimitive>\n\n      {startIcon && (\n        <SwitchIconPrimitive\n          position=\"left\"\n          className=\"absolute [&_svg]:size-[9px] left-0.5 top-1/2 -translate-y-1/2 dark:text-neutral-500 text-neutral-400\"\n        >\n          {startIcon}\n        </SwitchIconPrimitive>\n      )}\n      {endIcon && (\n        <SwitchIconPrimitive\n          position=\"right\"\n          className=\"absolute [&_svg]:size-[9px] right-0.5 top-1/2 -translate-y-1/2 dark:text-neutral-400 text-neutral-500\"\n        >\n          {endIcon}\n        </SwitchIconPrimitive>\n      )}\n    </SwitchPrimitive>\n  );\n}\n\nexport { Switch, type SwitchProps };\n",
      "type": "registry:ui",
      "target": "components/animate-ui/components/base/switch.tsx"
    }
  ],
  "type": "registry:ui"
}