Skip to main content
On this page

Let users select exactly one option from a group of mutually exclusive choices.

When to use​

  • When exactly one option must be selected from a group and no partial selection is valid
  • When the full set of options should be visible at once, so users can compare before choosing
  • When there are typically 2 to 7 options (for longer lists, consider Select Field)

When not to use​

  • When users can select more than one option - use Checkbox instead. Radios imply that only one selection is valid.
  • When there are many options - use Select Field instead. A long radio group is difficult to scan and takes up significant vertical space.
  • When there is only one option - a single radio button makes no sense semantically. Use Checkbox for a binary on/off choice.
  • To show a pre-selected option the user cannot change - the disabled state is not supported. Display the value as plain text or use a read-only Summary List instead. Do not use the disabled prop.

Anatomy​

  1. Group label
  2. Group hint text
  3. Radio control
  4. Item label
  5. Item hint text
  6. Error text

Basic usage​

Use RadioField to group related radio buttons. The label prop becomes the group's legend, which screen readers announce before each individual option. Pass a name prop so all radios in the group share the same form field name.

Loading...
Edit live code
<RadioField
  name="choose-climate-action-basic"
  label="Choose a climate action"
  defaultValue="reduceEm"
>
  <Radio label="Reduce emissions" id="emissions-basic" value="reduceEm" />
  <Radio label="Save energy" id="energy-basic" value="saveEn" />
  <Radio label="Reduce, reuse, recycle" id="3r-basic" value="3r" />
</RadioField>

Variants and features​

With hint text​

Hint text can be added at the group level to clarify the question, or at the item level to explain a specific option. Add item hint text only when the label alone may be unclear. Avoid adding hints to every option as a matter of course.

Group hint text clarifies the question as a whole:

Loading...
Edit live code
<RadioField
  name="climate-action-group-hint"
  label="Choose a climate action"
  hint="Choose the action where you can make the most difference"
  defaultValue="reduceEm"
>
  <Radio label="Reduce emissions" id="emissions-group-hint" value="reduceEm" />
  <Radio label="Save energy" id="energy-group-hint" value="saveEn" />
  <Radio label="Reduce, reuse, recycle" id="3r-group-hint" value="3r" />
</RadioField>

Item hint text explains a single option that the label alone does not make clear:

Loading...
Edit live code
<RadioField
  name="climate-action-item-hint"
  label="Choose a climate action"
  defaultValue="reduceEm"
>
  <Radio label="Reduce emissions" id="emissions-item-hint" value="reduceEm" />
  <Radio
    label="Act against forest loss"
    id="trees-item-hint"
    value="trees"
    hint="We plant a tree on your behalf each month"
  />
  <Radio label="Save energy" id="energy-item-hint" value="saveEn" />
</RadioField>

Horizontal layout​

Set horizontal on RadioField to lay out options side by side. Only use horizontal layout when there are 2 or 3 options, labels are short, and no item hint text is present. For most groups, the default vertical layout is easier to scan.

Loading...
Edit live code
<RadioField
  name="paperless-billing"
  label="Send bills by"
  defaultValue="email"
  horizontal
>
  <Radio label="Email" id="billing-email" value="email" />
  <Radio label="Post" id="billing-post" value="post" />
</RadioField>

Optional groups​

Mark the group as optional with the optional prop on RadioField. This appends "(optional)" to the group label. Required groups do not need a label suffix. Required is the default expectation.

Loading...
Edit live code
<RadioField label="Preferred contact method" name="contactMethod" optional>
  <Radio id="email" label="Email" value="email" />
  <Radio id="phone" label="Phone" value="phone" />
  <Radio id="post" label="Post" value="post" />
</RadioField>

Common form features​

For validation, error messages, and integration with the Form component, see the Forms pattern guide.