Components

RadioGroup

Single-option radio group with an options-driven or compound API, a card variant, icons, colours, descriptions and responsive columns.

iOSAndroid
Preview RadioGroup on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-radio-group

Usage

Options mode (same API as web)

import { RadioGroup, type RadioGroupOption } from '@/components/docyrus-native/radio-group';

const plans: RadioGroupOption[] = [
  { value: 'starter', label: 'Starter', description: 'Up to 3 projects', icon: 'fal seedling', color: 'emerald' },
  { value: 'pro', label: 'Pro', description: 'Unlimited projects', icon: 'fal rocket', color: 'indigo-500' },
  { value: 'legacy', label: 'Legacy', disabled: true }
];

<RadioGroup
  options={plans}
  value={plan}
  onValueChange={setPlan}
  variant="card"
  columnCount={2}
/>

Compound mode

import { RadioGroup, RadioGroupItem } from '@/components/docyrus-native/radio-group';

<RadioGroup defaultValue="option1" onValueChange={setSelected}>
  <RadioGroupItem value="option1" label="Option 1" />
  <RadioGroupItem value="option2" label="Option 2" description="With a description" />
  <RadioGroupItem value="option3" label="Option 3" icon="fal star" color="amber" />
</RadioGroup>

API Reference

RadioGroup

PropTypeDefaultDescription
optionsRadioGroupOption[]—Options-driven mode (web parity). When set, children are ignored
childrenReactNode—Compound mode — RadioGroupItem elements
valuestring—Controlled selected value
defaultValuestring—Initial value for uncontrolled mode. Ignored when value is provided
onValueChange(value: string) => void—Selection change handler
disabledbooleanfalseDisable all items
variant'default' | 'card''default'card renders each option as a bordered pressable card with a check indicator
columnCount1 | 2 | 3 | 4 | 51Grid columns. Collapses to 1 column below 400pt window width and to at most 2 below 768pt (mirrors web sm: / lg:). Values > 1 override orientation
size'sm' | 'md' | 'lg''md'Radio indicator + label size (native-only)
orientation'vertical' | 'horizontal''vertical'Layout direction (single-column layout only)
classNamestring—Additional classes for the group container

RadioGroupOption

FieldTypeDefaultDescription
valuestring—Option value (required)
labelstring—Label text (required)
descriptionstring—Secondary text below the label
iconstring—DocyrusIcon identifier (e.g. "fal star")
colorstring—Icon tint, or a colour dot when there is no icon. Tailwind colour name ("blue", "blue-500") or hex
disabledbooleanfalseDisable this option

RadioGroupItem

PropTypeDefaultDescription
valuestring—Item value (required)
labelstring—Label text
descriptionstring—Secondary text below the label
iconstring—DocyrusIcon identifier
colorstring—Icon tint / colour dot (Tailwind colour name or hex)
disabledbooleanfalseDisable this item
classNamestring—Additional classes for the pressable row / card
labelClassNamestring—Label classes

Components

ComponentDescription
RadioGroupRoot container — renders options, or provides context to RadioGroupItem children
RadioGroupItemIndividual radio (row or card, depending on the group variant)

Type Exports

TypeDescription
RadioGroupPropsProps for RadioGroup
RadioGroupItemPropsProps for RadioGroupItem
RadioGroupOptionOption shape for the options mode
RadioGroupSize'sm' | 'md' | 'lg'
RadioGroupOrientation'vertical' | 'horizontal'
RadioGroupVariant'default' | 'card'
RadioGroupColumnCount1 | 2 | 3 | 4 | 5

On this page