Radio

Pick one option from a set. Light follows the path of the choice.

Resources

Delivery method

A choice is required.

Delivery

Change option: light follows the path of the choice. Try the arrow keys too.

Frames
0
Active effects
0
Renderer
none

When to use it

  • For a single choice among a few options visible at once: delivery, plan.
  • Not for a long list (beyond about 7 options): a dropdown, coming soon. Not for an independent yes / no: use a checkbox.

Recommendations

  • Put the options in a logical order (cheapest to most expensive): light follows the HTML order, so the path makes sense.

Accessibility

The library

  • Native <input type="radio"> elements: arrow keys, single choice, label.
  • checked changes at once: no delay for screen readers. The path is visual only; radios along the way never look checked.
  • Path of 600 ms at most; beyond 3 changes per second, a simple fade.
  • Filled dot with 3:1 contrast, click area of at least 24 px, native control in high contrast.

Integration

  • The group in a <fieldset>, with a <legend> that holds the question, and the same name.
  • An error text for a required group.

WCAG 2.2 criteria: Non-text Contrast · Three Flashes or Below Threshold · Target Size (Minimum) · Error Identification

Props

PropTypePurpose
namestringThe group: light travels through the options between the old and new choice.
requiredbooleanRequired group: green dot, green line under the legend on first choice.
effects, onEffectEnd, refSame as the input.

Spec

The normative spec for this component: Formulaire

Availability and resources

Status
available · open source
Packages
@shader-ui/react (React, Next.js)
@shader-ui/core (TypeScript, plain HTML)
Source code
choice.ts (core) · Choice.tsx (React)