Radio group
Exactly one choice from a few, with every option visible. Seeing all the options is the point: use a Select when there are too many to show, and a Checkbox when more than one can be true.
Reach for it
One answer from a few options, all worth showing at once.
Not for
More options than fit comfortably, where a Select or Combobox reads better.
Vertical
The group is a single tab stop and the arrow keys move between options, which is what a keyboard user expects from a set of radios and the expensive part to get right by hand.
Applies to every invoice on this contract.
Horizontal
Suits two short options and nothing longer. Three long labels side by side stop being scannable, and wrap badly on a narrow screen.
Invalid
Inside a Field, the error is announced with the group rather than with one option, because the group is what failed.
Choose a method before continuing
API reference
RadioGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| options* | RadioOption[] | - | |
| data-testid | string | - | Names the element for a test. Never rendered, never announced. |
| value | string | - | |
| defaultValue | string | - | |
| onValueChange | (value: string) => void | - | |
| isDisabled | boolean | - | |
| orientation | 'vertical' | 'horizontal' | - | Horizontal suits two short options. Anything longer wraps badly. |
| name | string | - | |
| ariaLabel | string | - | Names the group when it is used outside a Field. Invisible, like Select's. |