Skip to content

Forms

RadioGroup

One choice out of two to five visible options, as a fieldset with a legend.

  • Experimental
  • Keyboard tested
  • Screen reader not tested yet

Updated 2026-11-12

Playground

Change the props. The controls come from the documented props.
Start
tsx
<RadioGroup
  label="Start"
  name="playground-start"
  options={[
    { value: "now", label: "Now" },
    { value: "quarter", label: "Next quarter" },
    { value: "open", label: "Not decided" },
  ]}
/>

States

Every variant in every state, side by side. Hover, pressed and focus are shown statically; the default state is interactive.
  • Choice
    default
  • Choice
    checked
  • Choice
    disabled
  • Choice

    Error: Choose an option.

    invalid

Usage

When to use

Use a radio group for one choice out of two to five options that people should see and compare side by side.

When not to use

  • For six or more options: use Select.
  • For one yes/no decision: use Checkbox.

How it works

A fieldset with a legend names the group; the native radios share one name. Tab enters and leaves the group, arrow keys move between options. Each option can have a hint. With required, Form reports a group without a choice.

Content guidelines

The legend asks the question, the options answer it in parallel form. Order options the way people think about them, not alphabetically. Use hints only where the difference between options isn't obvious from the label.

Do and don’t

Do
  • Order the options the way people think about them, not alphabetically.
Don’t
  • Don't use it for more than five options; use Select.

Anatomy

The parts of the component and what each one does, as in the playground above.
  1. legendThe question, 14px medium.
  2. option24px circle; checked shows an ink ring with a white centre.
  3. labelBody text, with an optional one-line hint.
  4. error-messageOne message for the whole group.

Examples

Type-checked, and the same code goes into the AI manifest. Import: import { RadioGroup } from "@/ds";

Project type

Project type
Understand the problem first.

Props

Checked against the component's TypeScript type on every build.
RadioGroup props
NameTypeDefaultDescription
label (required)string–The question, rendered as the legend.
name (required)string–Form field name.
options (required)RadioOption[]–value, label and an optional hint per option.
defaultValuestring–Option selected first. Leave empty when there is no sensible default.
requiredbooleanfalseA choice is needed to submit.
optionalbooleanfalseAdds “(optional)” to the legend.
hintstring–Help text under the legend.
errorstring–Error message; overrides native validation.
messagesValidationMessages–Texts for native validation.
disabledbooleanfalseDisables every option.

Tokens used

Derived from the utility classes in the component's source. Copy a class with one click.
Tokens used by RadioGroup
TokenTierValueUtility
choice.bordercomponent#8A8578
choice.checkedcomponent#0A0A0B
choice.sizecomponent24px
input.bgcomponent#FAFAF7
input.errorRingcomponent#C6492E
focussemantic#C6492E
spacing.1semantic4px
spacing.2semantic8px
spacing.3semantic12px
state.disabledsemantic0.5
surface.pagesemantic#FAFAF7
text.primarysemantic#0A0A0B
text.secondarysemantic#555555
type.body.sizesemantic16px
type.small.sizesemantic14px
weight.mediumsemantic500
weight.regularsemantic400

Accessibility

What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
Testing status by check
CheckHowStatus
axe-core rulesAutomated on every npm run check, at desktop and mobile widthRuns on every build
KeyboardAutomated Playwright test (scripts/keyboard.mjs)Tested
Screen readerManualNot tested yet

Keyboard

RadioGroup keyboard interactions
KeyAction
TabMoves into the group, to the selected option or the first one.
Arrow keysSelect the previous or next option.

Semantics and focus

  • <fieldset> and <legend> name the group; native radios share one name.
  • Tab enters and leaves the group; arrow keys move between options.

Contrast

RadioGroup contrast pairings
PairingRatio (x:1)MinimumStatus
text.primary on surface.page18.924.5Pass
text.secondary on surface.page7.134.5Pass
accent.default on surface.page4.574.5Pass
border.control on surface.page3.523.0Pass
focus on surface.page4.573.0Pass
border.control on surface.inverse5.383.0Pass
accent.default on surface.inverse4.143.0Pass
surface.inverse on accent.default4.143.0Pass