{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "radio-group",
  "title": "Radio Group",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-native/components/radio-group/RadioGroup.tsx",
      "content": "import * as React from 'react'\nimport { Pressable, View, type PressableProps, type ViewProps } from 'react-native'\nimport { Text } from '@/components/ui/text'\nimport { cn } from '@/lib/utils'\n\ninterface RadioGroupContextValue {\n  value: string | undefined\n  disabled: boolean\n  select: (value: string) => void\n}\n\nconst RadioGroupContext = React.createContext<RadioGroupContextValue | null>(null)\n\nexport interface RadioGroupProps extends ViewProps {\n  className?: string\n  value?: string\n  defaultValue?: string\n  onValueChange?: (value: string) => void\n  disabled?: boolean\n}\n\nconst RadioGroup = React.forwardRef<React.ComponentRef<typeof View>, RadioGroupProps>(\n  ({ value, defaultValue, onValueChange, disabled = false, className, accessibilityState, ...props }, ref) => {\n    const [internal, setInternal] = React.useState(defaultValue)\n    const resolved = value ?? internal\n    function select(next: string) {\n      if (disabled || next === resolved) return\n      if (value === undefined) setInternal(next)\n      onValueChange?.(next)\n    }\n    return (\n      <RadioGroupContext.Provider value={{ value: resolved, disabled, select }}>\n        <View\n          ref={ref}\n          {...props}\n          accessible={false}\n          accessibilityRole=\"radiogroup\"\n          accessibilityState={{ ...accessibilityState, disabled }}\n          className={cn('gap-[8px]', className)}\n        />\n      </RadioGroupContext.Provider>\n    )\n  },\n)\nRadioGroup.displayName = 'RadioGroup'\n\nexport interface RadioGroupItemProps extends PressableProps {\n  value: string\n  label: string\n  children?: React.ReactNode\n  className?: string\n}\n\nconst RadioGroupItem = React.forwardRef<React.ComponentRef<typeof Pressable>, RadioGroupItemProps>(\n  ({ value, label, children, className, disabled, onPress, accessibilityLabel, accessibilityState, ...props }, ref) => {\n    const group = React.useContext(RadioGroupContext)\n    if (!group) throw new Error('RadioGroupItem must be inside RadioGroup')\n    const checked = group.value === value\n    const isDisabled = group.disabled || !!disabled\n    return (\n      <Pressable\n        ref={ref}\n        {...props}\n        accessibilityRole=\"radio\"\n        accessibilityLabel={accessibilityLabel ?? label}\n        accessibilityState={{ ...accessibilityState, checked, disabled: isDisabled }}\n        disabled={isDisabled}\n        onPress={(event) => {\n          if (isDisabled) return\n          group.select(value)\n          onPress?.(event)\n        }}\n        className={cn(\n          'active:bg-muted min-h-[48px] flex-row items-center gap-3 rounded-md px-3 py-3',\n          isDisabled && 'opacity-50',\n          className,\n        )}\n      >\n        <View\n          aria-hidden\n          className={cn(\n            'size-[20px] items-center justify-center rounded-full border',\n            checked ? 'border-primary' : 'border-muted-foreground',\n          )}\n        >\n          {checked ? <View className=\"bg-primary size-[10px] rounded-full\" /> : null}\n        </View>\n        <View pointerEvents=\"none\" aria-hidden className=\"min-w-0 flex-1 gap-1\">\n          <Text className=\"font-medium\">{label}</Text>\n          {children}\n        </View>\n      </Pressable>\n    )\n  },\n)\nRadioGroupItem.displayName = 'RadioGroupItem'\n\nexport { RadioGroup, RadioGroupItem }\n",
      "type": "registry:ui",
      "target": "~/components/ui/radio-group/RadioGroup.tsx"
    },
    {
      "path": "packages/registry-native/components/radio-group/index.ts",
      "content": "export { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps } from './RadioGroup'\n",
      "type": "registry:ui",
      "target": "~/components/ui/radio-group/index.ts"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/text.json"
  ],
  "description": "Composable single-choice controls with controlled and uncontrolled state, radio semantics, and 48dp touch targets.",
  "categories": [
    "control"
  ]
}