Radio Group

A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.

Features

  • Full keyboard navigation.
  • Can be controlled or uncontrolled.

Install the component from your command line.

Import the components and piece the parts together.

Create your styled radio group component from the primitive parts.

Contains all the parts of a radio group.

PropTypeDefaultRequired
asenumdiv
defaultValuestring
valuestring
onValueChangefunction
requiredboolean

An item in the group that can be checked.

PropTypeDefaultRequired
asenumbutton
namestring
valuestring
onCheckedChangefunction
disabledboolean
requiredboolean
readOnlyboolean

Renders when the radio item is in a checked state. You can style this element directly, or you can use it as a wrapper to put an icon into, or both.

PropTypeDefaultRequired
asenumspan
forceMountboolean

Adheres to the Radio Group WAI-ARIA design pattern and uses roving tabindex to manage focus movement among radio items.

KeyDescription
TabMoves focus to either the checked radio item or the first radio item in the group.
SpaceWhen focus is on an unchecked radio item, checks it.
EnterWhen focus is on an unchecked radio item, checks it.
ArrowDownMoves focus to the next radio item in the group.
ArrowRightMoves focus to the next radio item in the group.
ArrowUpMoves focus to the previous radio item in the group.
ArrowLeftMoves focus to the previous radio item in the group.