MiHCM
primitives/@mihcm/ui·v0.21.0·stable

RadioGroup

Mutually exclusive option selection. Fieldset with RadioGroupItem children sharing state via React Context.

RadioGroup accessibility

WCAG 2.1 AA — release blocker

Semantics

  • Root renders as <fieldset> with role="radiogroup" so screen readers announce the group boundary.
  • Each RadioGroupItem uses role="radio" with aria-checked to indicate selection state.
  • Only one item can be aria-checked="true" at a time.

Keyboard navigation

  • Tab moves focus into/out of the group (focuses the selected item, or the first item if none selected).
  • Arrow keys move between items and select the focused item.
  • Items are wrapped in a single tab stop — only the selected item is in the tab order.

Labelling

  • Pair with a <legend> inside the fieldset or a Label component to provide a group-level accessible name.
  • Each RadioGroupItem child text serves as the accessible label for that option.

Disabled state

  • disabled on the group disables all items and sets aria-disabled on each.
  • Individual items can also be disabled independently.

Audit checklist

  • Screen reader announces group name and option count.
  • Arrow keys cycle through options and select them.
  • Tab moves focus in/out of the group as a single tab stop.
  • Disabled items cannot be selected via keyboard or pointer.
  • Focus ring is visible on the focused item (4.5:1 contrast).