# radiogroup

> The `radiogroup` ARIA role is used for a group of related radio buttons that allow users to select only one option from a set.

## How do I build an accessible radio group with ARIA?

The role used to group together a set of radio buttons where only one option can be selected. It helps users navigate and understand the selection constraints within the group.

- Topic: Basic Control Elements
- Type: role

## Example

Wrong:

```html
<p>Shipping</p>
<input type="radio" name="fast" id="f"> <label for="f">Fast</label>
<input type="radio" name="slow" id="s"> <label for="s">Slow</label>
```

Right:

```html
<fieldset>
  <legend>Shipping</legend>
  <label><input type="radio" name="ship" value="fast"> Fast</label>
  <label><input type="radio" name="ship" value="slow"> Slow</label>
</fieldset>
```

A shared `name` makes one group with arrow key navigation, and the legend gives the group its accessible name.

## Common mistakes

- Radio inputs with different `name` values, so the browser treats them as separate groups.
- A group question shown as plain text that is not tied to the radios.

## Key points

- Native radios share one `name` and sit in a `<fieldset>` with a `<legend>`, or the group has `role='radiogroup'` and a name.
- Only one radio in the group is in the Tab order; arrow keys move and select.
- Custom radios update `aria-checked` and only one is 'true' at a time.

## Interview questions

### Fieldset or role='radiogroup': which should I use?

Use `<fieldset>` with `<legend>` for native radios. Use `role='radiogroup'` with `aria-labelledby` for custom `role='radio'` elements.

### How should arrow keys work in a radio group?

Arrow keys move to the next or previous radio and select it. Tab leaves the group.

## Related cards

- [radio](https://wonderium.dev/a11y/radio.md)
- [`<fieldset>`](https://wonderium.dev/html/fieldset.md)
- [`<legend>`](https://wonderium.dev/html/legend.md)
- [group](https://wonderium.dev/a11y/group.md)
- [Accessible Forms](https://wonderium.dev/a11y/accessible-forms.md)

---

- Level: [Accessibility](https://wonderium.dev/a11y.md)
- HTML version: https://wonderium.dev/a11y/radiogroup
- Last updated: 2026-11-25
