Skip to main content

Radio Group

A group of radio buttons where only one option can be selected at a time.

Preview ยท Radio Group

Codeโ€‹

<div class="vstack" style="max-width:280px">
<fieldset>
<legend>Plan</legend>
<label><input type="radio" name="plan" value="starter" /> Starter</label>
<label><input type="radio" name="plan" value="pro" checked /> Pro</label>
<label><input type="radio" name="plan" value="ent" disabled /> Enterprise</label>
</fieldset>
<fieldset>
<legend>Billing</legend>
<div class="hstack">
<label><input type="radio" name="billing" /> Monthly</label>
<label><input type="radio" name="billing" checked /> Annual</label>
</div>
</fieldset>
</div>

Propsโ€‹

PropTypeDefaultDescription
namestringrequiredName attribute
options{label,value,disabled?}[][]Option list
valuestringโ€”Selected value
orientationvertical | horizontalverticalLayout direction

Accessibilityโ€‹

  • Wrap in <fieldset> + <legend> โ€” the legend is announced as the group label
  • Keyboard: arrow keys navigate between options within the group
  • Selected option has aria-checked="true" automatically from the browser
  • Never disable all options โ€” if none are valid, disable the containing form section
Version history

See the Changelog for version history and breaking changes.