Skip to content

Radio Group

A set of visible options that holds one persistent field value.

Retrieval method
hero.tsx

Usage guidelines

  • Use RadioGroup for one persistent field value from a small set of options that all stay visible. Use Select to choose from a closed, scannable list without text entry, SegmentedControl for one mode, view or filter for content that stays in place, and CheckboxGroup for several values from a visible set.
  • Every radio belongs to a RadioGroup. Do not render a standalone Radio or RadioItem.
  • Name the group with Fieldset and FieldsetLegend, and name each option with its own FieldLabel inside a FieldItem. Use aria-label on the group only when no visible legend exists.
  • Use Radio for the standard dot in a form row. Use RadioItem when custom content is itself the option, such as a card, and put RadioControl inside it for the indicator. RadioControl is visual only, never a standalone radio.
  • Keep the caller's value type. RadioGroup<Value>, Radio<Value> and RadioItem<Value> accept unions, booleans and numbers; JSX children do not inherit the parent's generic, so type each option when its value is not a string.
  • Pass disabled, readOnly, value, defaultValue and onValueChange to RadioGroup, not to Fieldset. Fieldset owns the group semantics and the legend relationship only.

Anatomy

tsx
tsx

Field gives the group its form name. Fieldset renders the RadioGroup element through render, so the legend names the radiogroup directly.

Examples

Option cards

Make the whole card the radio with RadioItem and render it as a native button. RadioControl draws the dot; point aria-labelledby at the title and aria-describedby at the supporting text so the name stays short.

Index method
option-cards.tsx

Typed controlled value

Control the value with value and onValueChange when another part of the page reads it. Here the value is a boolean, typed on the group and on each Radio.

Response mode

The API returns server-sent events as tokens arrive.

typed-value.tsx

Disabled option

Set disabled on a FieldItem to disable one option and its label. A FieldDescription in the same item explains why. Arrow keys skip the disabled option.

Parent chunk

Available for documents under 10,000 tokens.

disabled.tsx

Keyboard

KeyAction
TabMoves focus into the group on the selected radio, then out of the group.
Down arroworRight arrowMoves focus to the next enabled radio and selects it, wrapping at the end.
Up arroworLeft arrowMoves focus to the previous enabled radio and selects it, wrapping at the start.

API reference

Radio

A styled radio button control for standard form rows; pair with a visible FieldLabel or <label>. Renders a <span> element and a hidden <input> beside.

Base UI Radio.Root docs

Data attributes
AttributeDescription
data-checked

Present when the radio is checked.

data-unchecked

Present when the radio is not checked.

data-disabled

Present when the radio is disabled.

data-readonly

Present when the radio is readonly.

data-required

Present when the radio is required.

data-valid

Present when the radio is in a valid state (when wrapped in Field.Root).

data-invalid

Present when the radio is in an invalid state (when wrapped in Field.Root).

data-touched

Present when the radio has been touched (when wrapped in Field.Root).

data-dirty

Present when the radio's value has changed (when wrapped in Field.Root).

data-filled

Present when the radio is checked (when wrapped in Field.Root).

data-focused

Present when the radio is focused (when wrapped in Field.Root).

RadioControl

Renders the standard visual radio indicator inside a custom RadioItem. Renders a <span> element.

Base UI RadioControl docs

Data attributes
AttributeDescription
data-required

Present when the user must choose a value before submitting a form.

data-transitionstatus

Values: 'ending' | 'idle' | 'starting'

The transition status of the component.

data-checked

Present when the radio button is currently selected.

data-disabled

Present when the component should ignore user interaction.

data-readonly

Present when the user should be unable to select the radio button.

data-touched

Present when the radio button has been touched (when wrapped in Field.Root).

data-dirty

Present when the radio button's value has changed from its initial value (when wrapped in Field.Root).

data-filled

Present when the radio button has a value (when wrapped in Field.Root).

data-focused

Present when the radio button is focused (when wrapped in Field.Root).

RadioGroup

Provides shared single-selection state and keyboard navigation for a series of radio buttons. Renders a <div> element.

Base UI RadioGroup docs

Data attributes
AttributeDescription
data-disabled

Present when the radio group is disabled.

RadioItem

An unstyled radio item for custom radio layouts; pair with RadioControl to render the standard indicator. Renders a <span> element and a hidden <input> beside.

Base UI Radio.Root docs

Data attributes
AttributeDescription
data-checked

Present when the radio is checked.

data-unchecked

Present when the radio is not checked.

data-disabled

Present when the radio is disabled.

data-readonly

Present when the radio is readonly.

data-required

Present when the radio is required.

data-valid

Present when the radio is in a valid state (when wrapped in Field.Root).

data-invalid

Present when the radio is in an invalid state (when wrapped in Field.Root).

data-touched

Present when the radio has been touched (when wrapped in Field.Root).

data-dirty

Present when the radio's value has changed (when wrapped in Field.Root).

data-filled

Present when the radio is checked (when wrapped in Field.Root).

data-focused

Present when the radio is focused (when wrapped in Field.Root).

RadioSkeleton

Accepts the props of the element it renders.