Skip to main content
  1. Docs
  2. Components
  3. Forms

Radio

One answer from a few, all in view and always answered. The group is one Tab stop.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<div role="radiogroup">Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

When to use

Use it for
  • One answer from two to about five, worth seeing side by side.
  • A choice that's part of a form, saved with it.
  • Choices that need explaining, as tiles.
Not for

02

Anatomy

  1. 1radio<div>A row: its <label> makes all of it the target.
  2. 2radio-indicator<span role="radio">The circle; chosen, a 5px Ember ring.

03

Do and don't

Always answered
DoOne is chosen to start: the likeliest, or the safest.
Don'tNone chosen: a radio can't be cleared once it's set.
A long list is a Select
DoTen regions: one field, its list on demand.
Don'tTen radios down the page.

04

Content

  • The group's label asks the question: "Billing cycle".
  • Options are short and parallel: "1 hour", "8 hours".
  • A description says what an option costs or means.
Next — RadioAPI