Color
Typography
Spacing
Radius
Border
Opacity
Elevation
Blur
Avatar
Badge
Button
Checkbox
Input
ProgressBar
RadioButton
Separator
Slider
Switch
TextArea
TextLink
Accordion
Breadcrumb
ButtonGroup
Combobox
DropdownMenu
ListItem
Pagination
SegmentedControl
Select
Tooltip
Calendar
Card
CommandMenu
DatePicker
Dialog
Drawer
EmptyState
Footer
Form
NavigationBar
Sidebar
Skeleton
Table
Tabs
Toaster

RadioButton

Single choice within a group. Two values (Unselected, Selected), two sizes and five states. Includes a label and optional supporting text.

Caption text

Selected
Size

Usage

Import the component and render it.

import { RadioButton } from 'src/components/RadioButton/RadioButton';

<RadioButton size="md" label="Radio label" caption="Caption text" />

Accessibility

Role: radio (native <input type="radio">).

KeyAction
TabMoves focus into the group (to the selected option, or the first one)
Arrow keysMove to and select the next/previous option with the same name
SpaceSelects the focused option
  • Radios with the same `name` form one group; wrap a group in <fieldset> + <legend> (or role="radiogroup" with a label).
  • The label is a <label for> the input: clicking it selects the option.
  • The caption is linked with aria-describedby and is not part of the accessible name.
  • Hover/Pressed states also apply when pointing at the label, not only the circle.

Size

Set the size prop: Small is "sm", Medium is "md".

Caption text

Small

Caption text

Medium
<RadioButton size="sm" label="Radio label" />
<RadioButton size="md" label="Radio label" />

Selected

Set the checked prop: Unselected is {false}, Selected is {true}.

Caption text

Unselected

Caption text

Selected
<RadioButton label="Radio label" />
<RadioButton checked label="Radio label" />

States

Disabled comes from the disabled prop. Hover, Focus and Pressed follow the pointer and the keyboard: try them in the playground.

Caption text

Default

Caption text

Disabled
<RadioButton disabled label="Radio label" />

Actions

Pass callbacks to respond to the component.

import { RadioButton } from 'src/components/RadioButton/RadioButton';

<RadioButton
  size="md"
  label="Radio label"
  caption="Caption text"
  onCheckedChange={(checked) => console.log(checked)}
/>
CallbackWhen
onCheckedChangeFires when this option becomes selected.