Skip to content
Alea0.1

Forms

Radio

One choice from a short list, as rows or as cards.

Ant Design: Radio

import { RadioGroup, Radio } from '@alea/ui';

Examples

Radio group

One choice; arrows move and select.

Contrast standard

Cards

Each option as a tile, for plans and modes.

Plan

Horizontal

For two or three short options.

Theme

Props

RadioGroup props

One choice from a short list; arrow keys move between options.

PropTypeDefaultDescription
appearance"default" | "cards"'default'cards: each option as a bordered tile (good for plans or modes).
descriptionReactNode-Help text under the group.
errorMessageReactNode | ((v: ValidationResult) => ReactNode)-Error text, shown when the group is invalid.
labelReactNode-The visible label for the group.
orientation"horizontal" | "vertical"'vertical'vertical (default) or horizontal.

Radio props

One option of a RadioGroup.

PropTypeDefaultDescription
descriptionReactNode-Help text under the option label.

Accessibility

  • Arrow keys move and select within the group; Tab leaves it.

Keyboard

KeyDoes
TabMoves to the selected option
Arrow keysMove and select

Do and don't

Do

  • Pre-select the most common choice when it is safe.

Don't

  • Don't use for more than seven options: use Select.
Tested with axe, keyboard and screen reader roles