Browse the docs

RadioGroup

Radios fill with an ink blob. A fieldset of real radio inputs.

Client componentWCAG AASince v0.1

Live example

Priority

Change every prop live in the playground.

Props

RadioGroup

PropTypeDefaultWhat it does
childrenrequiredReactNodenoneThe Radio options.
legendrequiredReactNodenoneThe question, shown as the fieldset's legend.
classNamestringnoneExtra class on the fieldset.
defaultValuestringnoneUncontrolled initial selected value.
disabledbooleanfalseDisables every option in the group.
namestringa generated oneForm field name.
onValueChange(value: string) => voidnoneCalled with the chosen option's value.
valuestringnoneControlled selected value.
verticalbooleantrueStack options vertically.

Radio

PropTypeDefaultWhat it does
childrenrequiredReactNodenoneThe option's label.
valuerequiredstringnoneThe value the group reports when this option is chosen.
disabledbooleanfalseDisables just this option.
dotColorstringinkColor of the ink blob, as a CSS color or token variable.

Use it well

DoUse it for 2 to 5 choices people should see all at once.
Don'tLeave a group with nothing selected when one answer is the sensible default.

Accessibility

  • A <fieldset> and <legend> holding native radios.
  • Arrow keys move between options, as with any radio group.
Five stamps!

All aboard.

You took the whole tour. Here's Holo Pip, a foil sticker for riders who finish. It's in your playground tray now, for good.