RadioGroup
Use in a form to allow selecting one option from multiple
RadioGroup lets users choose one option from a keyboard-navigable set on web and native.
Features
Accessible, composable, and customizable
Sizing with controlled or uncontrolled state
Optional native HTML radio buttons on web
Installation
RadioGroup is already installed in tamagui, or you can install it independently:
yarn
npm
bun
pnpm
Usage
Headless usage
To use headless without @tamagui/core, install @tamagui/radio-headless:
yarn
npm
bun
pnpm
The @tamagui/radio-headless package provides three hooks for building custom radio groups:
useRadioGroup- for the container/groupuseRadioGroupItem- for individual radio itemsuseRadioGroupItemIndicator- for the indicator (checked state visual)
API reference
RadioGroup
RadioGroup extends View, inheriting all the Tamagui standard props, plus:
Props
name
string
Equivalent to input name attribute.
value
string
Controlled value of the selected radio item.
defaultValue
string
Default value for uncontrolled usage.
required
boolean
Sets aria-required attribute.
disabled
boolean
Sets aria-disabled on web, and disables touch on native for all children items.
native
boolean
Default:
falseRenders native radio button on web.
onValueChange
(value: string) => void
Called when the selected value changes.
orientation
"horizontal" | "vertical"
Orientation of the radio group.
accentColor
string
Sets `accent-color` style when `native` prop is enabled.
RadioGroup.Item
Item sizes come from the shared Sizing ladder.
Props
size
'xs' | 'sm' | 'md' | 'lg' | 'xl'
A named size ("xs" to "xl", default "md") is a rung in the sizing ladder: the circle is the ladder's square derivation.
labeledBy
string
Sets aria-labelledby on web.
value
string
Input value for the radio button.
disabled
boolean
Sets aria-disabled on web, and disables touch on native.
id
string
ID used on the web.
unstyled
boolean
Default:
falseWhen true, removes all default Tamagui styling.
RadioGroup.Indicator
RadioGroup.Indicator appears only when the parent Item is checked. It extends YStack, getting Tamagui standard props adding:
Props
unstyled
boolean
Removes all default Tamagui styles.
Headless props
useRadioGroup return value
| Property | Type | Description |
|---|---|---|
providerValue | RadioGroupContextValue | Value to pass to your context provider |
frameAttrs | object | Props to spread on the group container (role, aria-orientation, etc.) |
rovingFocusGroupAttrs | object | Props for roving focus behavior (optional) |
- Property
providerValue- Type
RadioGroupContextValue- Description
- Value to pass to your context provider
- Property
frameAttrs- Type
object- Description
- Props to spread on the group container (role, aria-orientation, etc.)
- Property
rovingFocusGroupAttrs- Type
object- Description
- Props for roving focus behavior (optional)
useRadioGroupItem
Hook for individual radio items. Requires a context containing the group state.
| Property | Type | Description |
|---|---|---|
checked | boolean | Whether this item is currently selected |
providerValue | object | Context value for the indicator |
frameAttrs | object | Props to spread on the item element |
bubbleInput | ReactNode | Hidden input for form compatibility |
native | boolean | Whether using native radio |
isFormControl | boolean | Whether inside a form |
- Property
checked- Type
boolean- Description
- Whether this item is currently selected
- Property
providerValue- Type
object- Description
- Context value for the indicator
- Property
frameAttrs- Type
object- Description
- Props to spread on the item element
- Property
bubbleInput- Type
ReactNode- Description
- Hidden input for form compatibility
- Property
native- Type
boolean- Description
- Whether using native radio
- Property
isFormControl- Type
boolean- Description
- Whether inside a form
useRadioGroupItemIndicator
Hook for the visual indicator of checked state.
| Property | Type | Description |
|---|---|---|
checked | boolean | Whether the parent item is checked |
data-state | string | ‘checked’ or ‘unchecked’ |
data-disabled | string | undefined | Present when disabled |
- Property
checked- Type
boolean- Description
- Whether the parent item is checked
- Property
data-state- Type
string- Description
- ‘checked’ or ‘unchecked’
- Property
data-disabled- Type
string | undefined- Description
- Present when disabled
Source
v2-look RadioGroup: token-based item sizing, theme background/border/focus styling, disabled dimming, and a centered color indicator over the unstyled @tamagui/ui RadioGroup behavior. This is the exact source the registry ships — copy it into your app and the examples above import from your copy.
components/tamagui/RadioGroup.tsxDependencies
yarn add @tamagui/core @tamagui/radio-groupExpects theme tokens: background, background-hover, background-press, border-color, border-color-hover, border-color-press, outline-color, color.
Need raw behavior without any skin? tamagui/unstyled re-exports the @tamagui/ui primitives (advanced).