{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toggle",
  "title": "Toggle",
  "description": "pressed two-state button",
  "dependencies": [
    "@rn-primitives/toggle@^1.5.2",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "@kit-native/icon",
    "@kit-native/lib-utils",
    "@kit-native/text"
  ],
  "files": [
    {
      "path": "components/ui/toggle.tsx",
      "content": "import { Icon } from '@/components/ui/icon';\nimport { TextClassContext } from '@/components/ui/text';\nimport { cn } from '@/lib/utils';\nimport * as TogglePrimitive from '@rn-primitives/toggle';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\nimport { Platform } from 'react-native';\n\nconst toggleVariants = cva(\n  cn(\n    'active:bg-muted group flex flex-row items-center justify-center gap-2 rounded-md',\n    Platform.select({\n      web: 'hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex cursor-default whitespace-nowrap outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:pointer-events-none [&_svg]:pointer-events-none',\n    })\n  ),\n  {\n    variants: {\n      variant: {\n        default: 'bg-transparent',\n        outline: cn(\n          'border-input active:bg-accent border bg-transparent shadow-sm',\n          Platform.select({\n            web: 'hover:bg-accent hover:text-accent-foreground',\n          })\n        ),\n      },\n      size: {\n        default: 'h-10 min-w-10 px-2.5 sm:h-9 sm:min-w-9 sm:px-2',\n        sm: 'h-9 min-w-9 px-2 sm:h-8 sm:min-w-8 sm:px-1.5',\n        lg: 'h-11 min-w-11 px-3 sm:h-10 sm:min-w-10 sm:px-2.5',\n      },\n    },\n    defaultVariants: {\n      variant: 'default',\n      size: 'default',\n    },\n  }\n);\n\nfunction Toggle({\n  className,\n  variant,\n  size,\n  ...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) {\n  return (\n    <TextClassContext.Provider\n      value={cn(\n        'text-sm text-foreground font-medium',\n        props.pressed\n          ? 'text-accent-foreground'\n          : Platform.select({ web: 'group-hover:text-muted-foreground' }),\n        className\n      )}>\n      <TogglePrimitive.Root\n        className={cn(\n          toggleVariants({ variant, size }),\n          props.disabled && 'opacity-50',\n          props.pressed && 'bg-accent',\n          className\n        )}\n        {...props}\n      />\n    </TextClassContext.Provider>\n  );\n}\n\nfunction ToggleIcon({ className, ...props }: React.ComponentProps<typeof Icon>) {\n  const textClass = React.useContext(TextClassContext);\n  return <Icon className={cn('size-4 shrink-0', textClass, className)} {...props} />;\n}\n\nexport { Toggle, ToggleIcon, toggleVariants };\n",
      "type": "registry:ui",
      "target": "components/ui/toggle.tsx"
    }
  ],
  "meta": {
    "exports": [
      "Toggle"
    ],
    "api": "<Toggle pressed onPressedChange><ToggleIcon as={…} /></Toggle>"
  },
  "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": [
    "actions"
  ],
  "type": "registry:ui"
}