---
title: "Radio button"
description: "Lets people choose exactly one option from a small group shown all at once."
url: "https://tanrei.chnotchy.com/components/radio-button/"
last_updated: 2026-10-23T21:17:12.000Z
---

# Radio button

> Lets people choose exactly one option from a small group shown all at once.

## Overview

### Usage

The revision that gave the radio button its present sizes and a ring that thickens into a fill changed only how it looks and moves, so every sample below is current. The web draws it as the spec says. SwiftUI, Compose, Flutter and React Native are lagging: until they catch up, they still draw the previous radio button, a 16 ring with a hairline stroke and an 8 dot in a 28 state layer, and do not reserve the 48 target height in layout. One refinement since then is on the web only so far: the ring and the fill are drawn as one shape.

**Web**

```html
<!-- The options with one name form a group. The group's name comes from the element around them. -->
<div role="radiogroup" aria-labelledby="frequency-label">
  <span id="frequency-label">How often</span>
  <tanrei-radio-button name="frequency" value="daily" label="Daily"></tanrei-radio-button>
  <tanrei-radio-button name="frequency" value="weekly" checked label="Weekly"></tanrei-radio-button>
  <tanrei-radio-button name="frequency" value="monthly" label="Monthly"></tanrei-radio-button>
</div>

<script type="module">
  import '@tanrei/web/components/radio-button';
  // Only the option that became selected fires change; the one it replaced does not.
  document.querySelector('[role="radiogroup"]').addEventListener('change', (e) => save(e.detail.value));
</script>
```

**React**

```tsx
import { RadioButton } from '@tanrei/react';

<div role="radiogroup" aria-labelledby="frequency-label">
  <span id="frequency-label">How often</span>
  {options.map(({ value, label }) => (
    <RadioButton
      key={value}
      name="frequency"
      value={value}
      label={label}
      checked={frequency === value}
      onChange={(e) => setFrequency(e.detail.value)}
    />
  ))}
</div>
```

**SwiftUI**

```swift
import Tanrei

// selection is a Binding<Frequency?>: an option is selected while it equals its value.
TanreiRadioGroup("How often") {
  TanreiRadioButton("Daily", value: Frequency.daily, selection: $frequency)
  TanreiRadioButton("Weekly", value: Frequency.weekly, selection: $frequency)
  TanreiRadioButton("Monthly", value: Frequency.monthly, selection: $frequency)
}
```

**Compose**

```kotlin
import androidx.compose.foundation.selection.selectableGroup
import io.github.chnotchy.tanrei.components.TanreiRadioButton

// The parent forms the group; each option's onClick captures its value.
Column(Modifier.selectableGroup()) {
    for ((value, label) in listOf("daily" to "Daily", "weekly" to "Weekly", "monthly" to "Monthly")) {
        TanreiRadioButton(selected = frequency == value, onClick = { frequency = value }, label = label)
    }
}
```

**Flutter**

```dart
import 'package:tanrei/tanrei.dart';

TanreiRadioGroup<Frequency>(
  groupValue: frequency,
  onChanged: (Frequency value) => setState(() => frequency = value),
  semanticLabel: 'How often',
  child: Column(
    children: <Widget>[
      for (final Frequency option in Frequency.values)
        TanreiRadioButton<Frequency>(value: option, label: option.label),
    ],
  ),
);
```

**React Native**

```tsx
import { RadioButton, RadioGroup } from '@tanrei/react-native';

<RadioGroup accessibilityLabel="How often">
  {options.map(({ value, label }) => (
    <RadioButton key={value} value={value} label={label} selected={frequency === value} onSelect={setFrequency} />
  ))}
</RadioGroup>
```

## Specs

In the default system the radio button is a 20 ring with a 2 stroke, on a round 40 state layer. A selected option draws no dot. Its ring thickens inward to half the radius, and the disc left inside is filled with the ring’s color at 16 % opacity: a light tint, which stands at least 3:1 apart from the ring. The ring keeps its outer size in both conditions. The ring and the fill are one shape: nothing behind the radio button shows between them at any zoom or display density, or in any frame of the change. When the selection changes, the stroke thickens or thins while the ring’s color changes and the fill fades in or out; the fill never grows from the center. A change that comes before the motion ends turns back from where it is, and where motion is reduced, the new condition shows at once and in full.

Each option takes at least 48 of height in layout, the target’s size, with the state layer centered in it. Options stacked with no gap between them therefore never share target area. A product that packs its options tighter lowers `option.min-height` in its own layer and accepts that the targets overlap.

Under `m3-like` the selected option keeps Material’s ring, gap and dot, but the dot fades in rather than scaling in from the center. Under `cupertino` the radio button keeps its smaller size and draws Apple’s look: a light disc in a thin ring, and a tinted band around a light center when selected.

- Category: Selection
- Level: base
- Listing: default
- Used in: Radio group
- Page: https://tanrei.chnotchy.com/components/radio-button/
- Spec: https://github.com/chnotchy/tanrei/blob/main/specs/radio-button.spec.json

### Availability

| Design system | Has it | Notes |
| --- | --- | --- |
| Tanrei (`tanrei`) | Yes | — |
| Cupertino (Apple HIG-inspired) (`cupertino`) | Yes | — |
| M3 Expressive-like (Material 3 Expressive-inspired) (`m3-expressive-like`) | Yes | — |
| M3-like (Material 3-inspired) (`m3-like`) | Yes | — |

### Platforms

- Web: the element `<tanrei-radio-button>`, registered by importing `@tanrei/web` (or only its own module, `@tanrei/web/components/radio-button`).
- React: `RadioButton` from `@tanrei/react`.

| Platform | Name | Status |
| --- | --- | --- |
| Web | `tanrei-radio-button` | lagging |
| SwiftUI | `TanreiRadioButton` | lagging |
| Jetpack Compose | `TanreiRadioButton` | lagging |
| Flutter | `TanreiRadioButton` | lagging |
| React Native | `RadioButton` | lagging |

Names a platform gives in its own idiom:

| Spec | Web | SwiftUI | Jetpack Compose | Flutter | React Native |
| --- | --- | --- | --- | --- | --- |
| `checked` (prop) | `checked` | `selection` | `selected` | `groupValue` | `selected` |
| `value` (prop) | `value` | `value` | `onClick` | `value` | `value` |
| `name` (prop) | `name` | `TanreiRadioGroup` | `selectableGroup` | `TanreiRadioGroup` | `RadioGroup` |
| `disabled` (prop) | `disabled` | `disabled` | `enabled` | `enabled` | `disabled` |
| `error` (prop) | `error` | `isError` | `isError` | `isError` | `error` |
| `label` (prop) | `label` | `title` | `label` | `label` | `label` |
| `labelHidden` (prop) | `labelHidden` | `labelsHidden` | `labelHidden` | `labelHidden` | `labelHidden` |
| `change` (event) | `change` | `selection` | `onClick` | `onChanged` | `onSelect` |

Statuses: `planned` — In the inventory. Nothing shippable exists yet. `lagging` — An implementation of an earlier spec exists; it has not caught up with the current one. `alpha` — Implemented with tests. The API may still change. `beta` — Feature complete and at parity. Only fixes are expected. `stable` — Covered by semantic versioning. `deprecated` — Still shipped; scheduled for removal.

### Anatomy

- `container`: The round state layer behind the ring. It carries hover, focus and press and is invisible at rest.
- `ring`: The circle that shows there is an option. Its outer diameter never changes; its stroke is thin while unselected and thickens inward, towards the center, while selected.
- `fill` (optional): What the ring leaves inside it, less an inset, tinted while selected (translucent in the default system) and clear while unselected. Where the inset is nothing it meets the ring's inner edge with no gap: ring and fill are drawn as one shape. It never grows or shrinks on its own, and it is never what carries the selection: the thickened ring is.
- `label` (optional): The visible text that names the option. A click on it selects the option.
- `focus-ring`: Gap-then-ring indicator shown for keyboard focus, around the ring.

### Props

| Prop | Type | Default | Web attribute | Description |
| --- | --- | --- | --- | --- |
| `checked` | `boolean` | `false` | `checked` | Whether this option is the one chosen in its group. Inside a radio group it follows the group's value. |
| `value` | `string` | `""` | `value` | What this option stands for: carried by change, and submitted with a form on the web. |
| `name` | `string` | `""` | `name` | The group this option belongs to where it does not stand in a radio group: on each platform that platform's bare way of forming a group (see platforms); the options of one group exclude each other and share one tab stop. Ignored inside a radio group, which is the group. |
| `disabled` | `boolean` | `false` | `disabled` | Prevents interaction; the option is skipped by the focus order and by the arrow keys. |
| `readOnly` | `boolean` | `false` | `readonly` | The person cannot select this option: it can still be focused and read, and the arrow keys still reach it, but a press, Space or an arrow key that lands on it selects nothing. Drawn as an enabled option, without the hover and press answers. A radio group that is read-only makes each of its options so (RAD-28). |
| `error` | `boolean` | `false` | `error` | Draws the option in the error form of its condition: the ring, and the fill while selected, in the error color (a required group left unanswered, a choice that cannot be taken). A radio group or a field group in error puts every option it holds there, so set it by hand only on options grouped without one (RAD-25). It draws and nothing more: the group, not the option, is exposed as invalid, and the words that say why are the group's. |
| `label` | `string` | `""` | `label` | The text that names the option: drawn next to the ring and used as the accessible name. |
| `labelHidden` | `boolean` | `false` | `label-hidden` | Draws no visible label but keeps label as the accessible name. |

### Events

| Event | Description |
| --- | --- |
| `change` | This option became selected by the user; carries its value. The option it replaced does not emit. Inside a radio group the group emits change in its place (RGP-4). |

### States

`enabled`, `disabled`, `hovered`, `focused`, `pressed`, `selected`, `error`

### Accessibility

- Role: `radio`
- Labeling: label is each option's accessible name, visible or not (labelHidden). The group's name (the question the options answer) is the radio group's label. Where options are grouped without a radio group (RAD-25) the product gives it: on the web a container with role radiogroup and aria-labelledby; on the other platforms the group container's label.
- Minimum target size: yes

| Keys | Action |
| --- | --- |
| Tab / Shift+Tab | Moves focus into the group (to the selected option, or the first enabled one when none is selected) and out of it. |
| Space | Selects the focused option if it is not selected; nothing while it is read-only. |
| Down Arrow / Right Arrow | Moves to the next enabled option and selects it, wrapping (Left Arrow in right-to-left); an option that is read-only is focused and not selected. |
| Up Arrow / Left Arrow | Moves to the previous enabled option and selects it, wrapping (Right Arrow in right-to-left); an option that is read-only is focused and not selected. |
| Enter | Nothing on the web (it submits the form); selects where the platform activates any focused control with Enter (Android, tvOS). |

- Scope: this spec covers the option, and what holds among the options of any group however it is formed (RAD-3, RAD-4, RAD-5, RAD-16). The radio group component (`radio-group`) is the group in the usual case: it holds the value, names the set and draws its label, its description and its error. Grouping without it (RAD-25) is for options that one container cannot lay out — one in each row of a table or a list, one on each card — and draws nothing, so it has no tokens.
- iOS has no radio role: an option is exposed as a button with the selected trait, and its position ("2 of 3") through its accessibility value.
- The ring alone carries the selected condition at 3:1 against the surface (WCAG 1.4.11): the selected ring is sys.color.primary, which the build holds to 4.5:1 on every surface role, and its stroke is 2.5 times the unselected one, so the selection does not rest on color alone (WCAG 1.4.1). The translucent fill is not counted for that, but it is a part of the mark, and WCAG 1.4.11 measures a part against the colors next to it: where the fill meets the ring (fill.inset 0) it is held 3:1 against the ring, and where an inset leaves a gap (a dot) it is held 3:1 against the gap, which shows what the radio stands on. The build holds it as drawn — the fill at comp.radio-button.fill.opacity and the ring, each over the state layer of the state — at rest, hovered, focused and pressed (a disabled option is exempt, as WCAG exempts an inactive control), on every surface role, in every scheme; in the default system the fill is the ring's color at 16 %, 3.17:1 from the ring at the least (the focused error form on surface-container-highest in light). In an error form the ring is sys.color.error, which the build holds to 4.5:1 on every surface role as it holds the primary role, so both error forms keep 3:1 (WCAG 1.4.11) and the selection is still told by the stroke.
- A group in error is said by the radio group — its error text and its invalid state (RGP-8) — and shown on every option of it: the ring, and the fill of the selected one, take the error color (RAD-26), as a checkbox's box does (CHK-4). The color is one more sign and never the only one (WCAG 1.4.1): the words and the state carry the error, and the option exposes no invalid state of its own, because the radio role has none. The option has an error condition so that one form marks its checkboxes and its radio buttons by one rule.
- Read-only (RAD-28) is said by the group, never by the option: WAI-ARIA has aria-readonly on radiogroup and not on radio. A radio group that is read-only says it (RGP-20); options grouped by name alone are read-only as a set when each is, and the product says it on the container it gives them (on the web, aria-readonly on the element with role radiogroup). HTML's readonly attribute does not apply to a radio button, so the option cancels its activation itself.

### Behaviour

Requirements in EARS form, each with its stable id.

- **RAD-1** WHEN the user activates an unselected radio button by pointer, touch, Space, assistive technology or a click on its label THE radio button SHALL become selected and emit change exactly once with its value; Enter SHALL activate it only on a platform whose convention activates any focused control with Enter (Android, tvOS), and SHALL NOT on the web, where Enter submits the form.
- **RAD-2** WHEN the user activates a radio button that is already selected THE radio button SHALL stay selected and SHALL NOT emit change: a radio button is never cleared by its own activation.
- **RAD-3** WHEN a radio button becomes selected THE other radio buttons of its group SHALL become unselected, without emitting change.
- **RAD-4** WHEN a radio button in a group has keyboard focus and the user presses Down Arrow or Right Arrow THE group SHALL move focus to the next enabled radio button, wrapping from the last to the first, and select it; Up Arrow and Left Arrow SHALL do the same towards the previous one; in a right-to-left layout Right Arrow SHALL move to the previous and Left Arrow to the next.
- **RAD-5** THE group SHALL keep exactly one of its radio buttons in the tab order: the selected one, or the first enabled one while none is selected; Tab SHALL leave the group rather than move within it.
- **RAD-6** WHILE disabled is true THE radio button SHALL NOT change or emit change, SHALL NOT be focusable, SHALL be skipped by the arrow keys, SHALL ignore clicks on its label and SHALL expose the disabled state to assistive technology.
- **RAD-7** WHILE hovered, keyboard-focused or pressed THE radio button SHALL render its container, ring, fill, label and opacity from the component tokens of its condition (selected or unselected, or the error- form of either, RAD-26) in the highest-precedence active state, with precedence pressed over focused over hovered; focus gained by pointer or touch SHALL NOT select the focused state. A part the interaction states recolor changes over the component's state motion, as the container does; only a change of condition uses the selection motion (RAD-15).
- **RAD-8** WHEN the radio button receives keyboard focus THE radio button SHALL show the focus ring around its ring without animation; focus gained by pointer or touch SHALL NOT show it.
- **RAD-9** WHERE the visual size is below the minimum target THE radio button SHALL extend its hit area on both axes to sys.target.touch for touch input and sys.target.pointer for fine pointers, without changing its visual size; a platform that cannot tell the input type SHALL use sys.target.touch. The visible label SHALL be part of the hit area as well.
- **RAD-10** WHILE disabled is true THE radio button SHALL render its container, ring, fill, label and opacity from the disabled component tokens of its condition.
- **RAD-11** WHEN the radio button is pressed by pointer, touch or Space, or by Enter where Enter activates it (Android, tvOS; never on the web, where Enter submits the form) THE radio button SHALL show the pressed state without delay and SHALL keep it visible for at least sys.motion.duration.press-hold, even when the press ends sooner.
- **RAD-12** WHILE pressed THE radio button SHALL answer as sys.behavior.pressed-feedback names: overlay applies the pressed tokens to the whole container at once; ripple grows the pressed state layer from the point of contact (from the center for keyboard activation; a press outside the container (on the label) grows it from the container's center); dim applies the pressed opacity to the whole control and draws no state layer; none draws no answer to the press. Under ripple and dim only the container color stays with the state under the press; ring, fill, label, opacity and shape still come from the pressed tokens. Under none every part stays with the state under the press. The ripple grows over comp.radio-button.motion.feedback-duration with motion.state-easing, fades over motion.state-duration with motion.state-easing once the press has ended and press-hold has passed, and appears whole where motion is reduced.
- **RAD-13** THE radio button SHALL ease its container corners by sys.shape.corner-smoothing (0 is a quarter circle, 0.6 the iOS continuous corner; a platform with only the OS curve draws it for any amount above 0) and show its keyboard focus as sys.behavior.focus-style names (ring or glow); a platform that cannot draw a choice SHALL fall back to the first value and state that in its README.
- **RAD-14** THE radio button SHALL draw a ring of outer diameter comp.radio-button.ring.size centered in a round container of diameter comp.radio-button.container.size, the outer diameter the same in both conditions; while unselected the ring SHALL be stroked at comp.radio-button.ring.width inside that diameter, and while selected at comp.radio-button.ring.selected-width-share of the ring's radius (1 being a stroke as wide as the radius, a solid disc), or at comp.radio-button.ring.width where that is wider, the stroke growing inward from the outer diameter. It SHALL draw no dot of its own; what is drawn inside the ring is the fill (RAD-19).
- **RAD-15** WHEN the radio button becomes selected THE radio button SHALL, over comp.radio-button.motion.selection-duration with comp.radio-button.motion.selection-easing, thicken the ring's stroke inward from its unselected to its selected width, change the ring color from the unselected to the selected one, and run the fill's color continuously from comp.radio-button.unselected.fill.color (none in the default system) to comp.radio-button.selected.fill.color, fading the opacity in from none rather than passing through any other color; WHEN it becomes unselected it SHALL run the same change in reverse; the fill SHALL NOT grow from or shrink to the center; WHERE motion is reduced it SHALL show the new condition at once and in full, with no intermediate frame.
- **RAD-16** THE radio button SHALL expose the role radio with the state checked or not checked, and its position in its group and the group's size; THE group SHALL be exposed as a radio group: the radio group component, named by its label (RGP-10), or, where the options are grouped without one (RAD-25), a container whose accessible name the product gives.
- **RAD-17** WHILE label is not empty and labelHidden is false THE radio button SHALL draw label at the inline end of the container, comp.radio-button.label.gap away, in comp.radio-button.label.typescale, wrapping rather than truncating, the control centered on the label's first line; right-to-left layouts SHALL mirror the order.
- **RAD-18** WHILE labelHidden is true THE radio button SHALL draw no label and SHALL still expose label as its accessible name; WHILE label is not empty, or a Field that frames it gives it a label, THE radio button SHALL expose that label as its accessible name, over a name the product gives it on the element (aria-label or aria-labelledby); WHILE label is empty and the product gives the radio button a name of its own on the element — aria-label, or aria-labelledby naming an element — THE radio button SHALL expose that name as its accessible name; WHILE label is empty and the product gives it none THE radio button SHALL still render, and in debug builds report that it has no accessible name.
- **RAD-19** THE radio button SHALL draw the fill in both conditions: the area inside the ring's inner edge at that moment, less comp.radio-button.fill.inset all round, never under the ring, in the fill color of its condition and state (comp.radio-button.selected.fill.color or comp.radio-button.unselected.fill.color at rest, and comp.radio-button.error-selected.fill.color or comp.radio-button.error-unselected.fill.color in the error forms, RAD-26; an unselected one is none in the default system, so an unselected option shows no fill there) at comp.radio-button.fill.opacity; a fill whose diameter would be zero or less SHALL NOT be drawn.
- **RAD-20** WHEN the condition changes again before the selection motion of RAD-15 has finished THE radio button SHALL turn the change back from the stroke width and the ring and fill colors it has reached, and SHALL NOT jump to either end.
- **RAD-21** THE radio button SHALL take at least comp.radio-button.option.min-height of height in layout, the container centered in it; at its default, sys.target.touch, radio buttons stacked with no space between them keep whole targets that do not overlap, and a layer that lowers it accepts shared target area.
- **RAD-22** THE radio button SHALL take its layout direction from where it is used — the direction of the nearest ancestor that sets one, and the platform's own where none does — and SHALL have no direction setting of its own; WHEN that direction changes while the radio button is shown THE radio button SHALL draw itself for the new direction at once, without a motion of its own, keeping its selection and its focus.
- **RAD-23** THE radio button SHALL lay out its label as text of its own direction, isolated from the text around it: each takes the base direction of its first strong character, or the layout direction where it has none, so that a left-to-right word, a number with its sign or unit, a telephone number and an address keep their own order in a right-to-left layout and reorder nothing beside them; THE radio button SHALL still place the label and align its lines by the layout direction, not by the text's own.
- **RAD-24** WHILE comp.radio-button.fill.inset is 0 (the default system's) THE radio button SHALL draw the ring and the fill as one shape: every point inside the ring's outer diameter SHALL be painted by the ring, by the fill, or, along the circle where the two meet, by both in shares that add up to the whole, so that nothing behind the radio button shows between the ring's inner edge and the fill at any zoom, display density or fractional position, or in any frame of the selection motion (RAD-15); neither SHALL be painted over the other (RAD-19), so that the fill is nowhere more or less opaque than comp.radio-button.fill.opacity makes it. WHILE comp.radio-button.fill.inset is above 0 the space it leaves between the ring and the fill SHALL show what is behind the radio button, as wide as the inset all round.
- **RAD-25** WHILE the radio button stands in a radio group THE radio button SHALL take its group from it and from nothing else: checked SHALL follow the radio group's value and its own value (RGP-3), name SHALL be ignored, it SHALL be disabled WHILE the radio group is (RGP-7), and its selection by the person SHALL be reported by the radio group's change and by no event of its own that a listener on the group would receive as well (RGP-4). WHERE the radio button stands in no radio group it SHALL form its group by the platform's bare idiom — on the web the radio buttons of one name in the same form, or in the same document or shadow root outside a form — and RAD-3, RAD-4, RAD-5 and RAD-16 SHALL hold among those, the group's name, its required and invalid states and its layout being the product's, or those of a field group whose kind is radio-group that the product put around them (FGR-25). A radio button in no group at all SHALL still render and be selectable, as a group of one, and in debug builds SHALL report it where the platform can tell (on the web, a radio button with neither a radio group nor a name).
- **RAD-26** THE radio button SHALL draw the condition its props select — selected WHILE checked is true, otherwise unselected — and the error- form of that condition (error-selected, error-unselected) WHILE it is in error: WHILE error is true, or WHILE the radio group or the field group it stands in is in error and has put it there (RGP-8, FGR-8), as a checkbox draws the error- form of its condition (CHK-4). In an error form THE radio button SHALL render its container, ring, fill, label and opacity from the component tokens of that form in every state — at rest, hovered, focused and pressed with the precedence of RAD-7, and disabled as RAD-10 says — and SHALL change nothing else: the ring's diameter and its stroke in each condition (RAD-14), the fill's inset and opacity (RAD-19), the label, the focus indication (RAD-8), the hit area (RAD-9) and the selection motion (RAD-15), which runs between the two error forms' colors, are those of the same condition out of error. WHILE disabled is true the disabled tokens of the error form apply, which in the default system are the values of the plain form's: a disabled option shows no error color, because it cannot be the answer that puts the error right. WHEN the radio button enters or leaves the error forms without a change of selection THE radio button SHALL only recolor its ring and its fill, over comp.radio-button.motion.selection-duration with comp.radio-button.motion.selection-easing, and at once WHERE motion is reduced; nothing SHALL change size or move. THE radio button SHALL expose no invalid state and take no description for the error: the radio role has no such state, the group the options form carries it and the words that say why (RAD-16, RGP-10, FGR-25), and an option that repeated them would say the error once for every arrow key. It SHALL never set error itself, and being selected SHALL NOT clear it. WHERE the options are grouped without a radio group or a field group (RAD-25) error is the product's to set, on every option of the group together with the invalid state of the group it built.
- **RAD-27** WHERE the platform draws with a person's own forced colors (the web's forced-colors mode, and a platform's equivalent where it has one) THE radio button SHALL draw each error form exactly as it draws the same condition out of error there — its ring in the platform's own colors, the stroke's weight carrying the selection — and SHALL show no error color, because the person's colors leave none to show: the error is carried by the words of the group's error text and by the group's invalid state (RGP-14, FGR-17).
- **RAD-28** WHILE readOnly is true and disabled is false, or WHILE the radio group it stands in is read-only (RGP-20), THE radio button SHALL stay focusable, keep its place in its group's single tab stop (RAD-5) and be reached by its group's arrow keys (RAD-4); SHALL NOT become selected, and SHALL NOT emit change, on any activation — pointer, touch, Space, Enter where Enter activates it, assistive technology, a click on its label, a click dispatched on the element or an arrow key that moves focus to it — so that an arrow key moves focus to it and selects nothing, and from it moves focus on as RAD-4 says, selecting the option it lands on only where that option is not read-only; and SHALL be drawn from the resting component tokens of its condition — the enabled ones, never the disabled ones — and SHALL show no hovered and no pressed state, under any pressed feedback (no overlay, no ripple, no dim), while keyboard focus still selects the focused state and shows the focus ring (RAD-7, RAD-8). The radio role has no read-only state: the group says it — the radio group (RGP-20), or, where options are grouped without one (RAD-25), the container the product gives them. The product may still set checked. WHILE disabled is true as well, disabled wins (RAD-6).
- **RAD-29** WHERE the platform has ARIA attributes (the web), WHEN the product sets an aria- attribute on the host, by the attribute or by the ARIA property that reflects it, THE radio button SHALL move it to the data-aria- attribute of the same name, so that the host is no second node with its name, description or state, and SHALL expose it on the element that carries its role — an id reference by the elements it names in the host's tree or a tree around it, an error message as part of the description while the radio button is invalid — except those the radio button owns (aria-checked, aria-pressed, aria-disabled), which it SHALL move and not expose. WHEN the product removes the aria- attribute or its data-aria- twin, or sets the ARIA property that reflects it (ariaLabel, ariaDescribedByElements…) to null, THE radio button SHALL take it off that element. WHEN the product sets an aria- attribute the radio button owns THE radio button SHALL report it in debug builds.

### Tokens

As written in the token documents (DTCG): an alias in braces names the token it takes its value from, which each design system resolves. On the web each token is a CSS custom property: `--tanrei` and the name after `tanrei`, joined by hyphens (`tanrei.comp.radio-button.…` → `--tanrei-comp-radio-button-…`).

#### `tanrei.comp.radio-button`

| Token | Type | Value |
| --- | --- | --- |
| `comp.radio-button.option.min-height` | `dimension` | `{tanrei.sys.target.touch}` |
| `comp.radio-button.container.shape` | `dimension` | `{tanrei.sys.shape.corner.full}` |
| `comp.radio-button.container.size` | `dimension` | `40px` |
| `comp.radio-button.ring.size` | `dimension` | `20px` |
| `comp.radio-button.ring.width` | `dimension` | `{tanrei.sys.border.thick}` |
| `comp.radio-button.ring.selected-width-share` | `number` | `0.5` |
| `comp.radio-button.fill.inset` | `dimension` | `0px` |
| `comp.radio-button.fill.opacity` | `number` | `{tanrei.sys.state.selected-state-layer-opacity}` |
| `comp.radio-button.label.typescale` | `typography` | `{tanrei.sys.typescale.body}` |
| `comp.radio-button.label.gap` | `dimension` | `{tanrei.sys.space.space50}` |
| `comp.radio-button.unselected.container.color` | `color` | `{"colorSpace":"srgb","components":[0,0,0],"alpha":0,"hex":"#000000"}` |
| `comp.radio-button.unselected.ring.color` | `color` | `{tanrei.sys.color.outline}` |
| `comp.radio-button.unselected.fill.color` | `color` | `{"colorSpace":"srgb","components":[0,0,0],"alpha":0,"hex":"#000000"}` |
| `comp.radio-button.unselected.label.color` | `color` | `{tanrei.sys.color.on-surface}` |
| `comp.radio-button.unselected.state-layer.color` | `color` | `{tanrei.comp.radio-button.unselected.ring.color}` |
| `comp.radio-button.selected.container.color` | `color` | `{"colorSpace":"srgb","components":[0,0,0],"alpha":0,"hex":"#000000"}` |
| `comp.radio-button.selected.ring.color` | `color` | `{tanrei.sys.color.primary}` |
| `comp.radio-button.selected.fill.color` | `color` | `{tanrei.comp.radio-button.selected.ring.color}` |
| `comp.radio-button.selected.label.color` | `color` | `{tanrei.sys.color.on-surface}` |
| `comp.radio-button.selected.state-layer.color` | `color` | `{tanrei.comp.radio-button.selected.ring.color}` |
| `comp.radio-button.error-unselected.container.color` | `color` | `{"colorSpace":"srgb","components":[0,0,0],"alpha":0,"hex":"#000000"}` |
| `comp.radio-button.error-unselected.ring.color` | `color` | `{tanrei.sys.color.error}` |
| `comp.radio-button.error-unselected.fill.color` | `color` | `{"colorSpace":"srgb","components":[0,0,0],"alpha":0,"hex":"#000000"}` |
| `comp.radio-button.error-unselected.label.color` | `color` | `{tanrei.sys.color.on-surface}` |
| `comp.radio-button.error-unselected.state-layer.color` | `color` | `{tanrei.comp.radio-button.error-unselected.ring.color}` |
| `comp.radio-button.error-selected.container.color` | `color` | `{"colorSpace":"srgb","components":[0,0,0],"alpha":0,"hex":"#000000"}` |
| `comp.radio-button.error-selected.ring.color` | `color` | `{tanrei.sys.color.error}` |
| `comp.radio-button.error-selected.fill.color` | `color` | `{tanrei.comp.radio-button.error-selected.ring.color}` |
| `comp.radio-button.error-selected.label.color` | `color` | `{tanrei.sys.color.on-surface}` |
| `comp.radio-button.error-selected.state-layer.color` | `color` | `{tanrei.comp.radio-button.error-selected.ring.color}` |
| `comp.radio-button.motion.state-duration` | `duration` | `{tanrei.sys.motion.role.state.compact}` |
| `comp.radio-button.motion.state-easing` | `cubicBezier` | `{tanrei.sys.motion.easing.state}` |
| `comp.radio-button.motion.feedback-duration` | `duration` | `{tanrei.sys.motion.role.feedback}` |
| `comp.radio-button.motion.selection-duration` | `duration` | `{tanrei.sys.motion.role.selection.mark}` |
| `comp.radio-button.motion.selection-easing` | `cubicBezier` | `{tanrei.sys.motion.easing.state}` |

Per-state tokens, valued by the design system's pattern rules (not written by hand):

- `comp.radio-button.<variant>.<state>.<property>` for the variants `unselected`, `selected`, `error-unselected`, `error-selected`, the states `hovered`, `focused`, `pressed`, `disabled` and the properties `container.color`, `ring.color`, `fill.color`, `label.color`, `state-layer.color`.
- `comp.radio-button.<state>.<property>` for the states `hovered`, `focused`, `pressed`, `disabled` and the properties `opacity`, `container.shape`.

## Guidelines

### When to use

Use radio buttons when a question has exactly one answer and a small number of options that people should compare side by side, such as a delivery speed or how often to send a summary. Every option is visible at once, so the group takes space. When there are many options, or the space is short, use a list or a menu that shows only the chosen one.

A group can start with one option selected when that option is a safe and likely answer. Leave every option unselected when you need the person to answer deliberately. Once an option is selected, the person cannot return the group to no selection, because a radio button is never cleared by its own activation. If “none” is a valid answer, add it as an option.

### Checkbox, radio button or switch

| Control | Choices | Takes effect | Use for |
| --- | --- | --- | --- |
| [Checkbox](https://tanrei.chnotchy.com/components/checkbox/) | Any number of independent choices, including none | When the person confirms | Options in a form, agreeing to terms, selecting rows |
| Radio button | Exactly one from a small group, all shown | When the person confirms, usually | One answer to one question |
| [Switch](https://tanrei.chnotchy.com/components/switch/) | One setting, on or off | At once | Settings that apply as soon as they change |

### Do

- Give every group a name: the question its options answer, shown as visible text before the group.
- Stack the options vertically and put them in an order that makes sense for the question, such as from smallest to largest. Each option already reserves its target’s height, so a stack needs no extra gap.
- Keep the labels short and parallel in form, so they are easy to compare.
- Keep the options of one group together in one container.

### Don’t

- Don’t use a single radio button on its own. For one yes-or-no choice, use a checkbox or a switch.
- Don’t use radio buttons for choices that do not exclude each other. Use checkboxes.
- Don’t start a heavy action, such as navigating away, the moment an option is selected. The arrow keys select each option they pass, so a keyboard user would trigger it on the way to the one they want.
- Don’t split one group across different parts of the screen.

## Accessibility

### What the component handles

- Each option exposes the radio role, whether it is selected, its disabled state, and its position in the group with the group’s size (“2 of 3”). Apple platforms have no radio role, so there an option is a button with the selected trait and its position is its accessibility value. Flutter’s semantics cannot state the position yet.
- The label is the accessible name, whether it is drawn or hidden with `labelHidden`. The drawn text is hidden from assistive technology, so the name is read once.
- A group has one tab stop: the selected option, or the first enabled one while none is selected. The arrow keys move to the next or previous enabled option and select it, wrapping at the ends; Left and Right swap in a right-to-left layout.
- Space selects the focused option. Enter selects it only where the platform activates any focused control with Enter (Android, tvOS); on the web, Enter submits the form.
- While `readOnly` is set, or while the radio group around it is read-only, an option stays focusable and the arrow keys still reach it, but nothing selects it: not a press, Space, a click on the label, `click()` or an arrow key that lands on it. It shows no hover or press feedback. The radio role has no read-only state, so the group says it.
- Selecting an option unselects the others. Only the option that became selected reports the change, and activating the selected option does nothing.
- A click or tap on the label selects the option. The label is part of the hit area, and the hit area meets the minimum target. Each option reserves the target’s height in layout, so stacked options keep whole, separate targets.
- The selection is carried by the ring alone: the selected ring holds 3:1 against every surface in the default system, and it is two and a half times as thick as the unselected one. The translucent fill is not counted for that, but it is held 3:1 apart from the ring it meets, in every state, on every surface and in every scheme (WCAG 1.4.11), so the center of the chosen option is seen as well.
- It shows the focus indicator for keyboard focus only.
- Where motion is reduced, the new condition shows at once and in full.
- A missing label is reported in debug builds.

Known platform gaps:

- SwiftUI, Compose, Flutter and React Native still draw the previous radio button, with a dot and at the previous sizes, do not yet draw the ring and the fill as one shape, and do not reserve the target’s height in layout, so stacked options with no gap share target area.
- `readOnly` is on the web only so far: SwiftUI, Compose, Flutter and React Native do not have it yet.
- Under `m3-like`, the selected dot fades in at its full size, where Material scales it in from the center (mimicry gap `radio-dot-scale-in`).

### What you need to do

- Name the group with the question it answers. On the web, wrap the options in an element with `role="radiogroup"` and `aria-labelledby`, or in a `<fieldset>` with a `<legend>`. In Flutter, set `semanticLabel` on `TanreiRadioGroup`; in React Native, set `accessibilityLabel` on `RadioGroup`.
- Form the group in the platform’s way, so the keys and the position work: one `name` on the web, `Modifier.selectableGroup()` on the parent in Compose, `TanreiRadioGroup` in Flutter and `RadioGroup` in React Native.
- Where you group options by `name` yourself and make each one read-only, say it on the container: `aria-readonly="true"` beside `role="radiogroup"`. A [radio group](https://tanrei.chnotchy.com/components/radio-group/) with `readOnly` does this for you.
- If the question is required and left unanswered, show the message on the group: a [radio group](https://tanrei.chnotchy.com/components/radio-group/) in error draws its error text and puts every radio button in its error form. For options grouped without one, set `error` on each radio button: the ring and the dot take the error color, as a checkbox’s box does. A disabled option shows no error color.
- A radio button in error is not exposed as invalid, because its role has no such state. The group says it: a radio group is invalid and described by its error text. Where you group the options yourself, say the error in words beside them.
- If you restyle the ring and the fill in your own layer, keep the ring strong enough to show the selection on its own. The build does not check it.
- In React Native, pass `positionText` to `RadioGroup` when the product is not in English. By default the position is announced as “2 of 3”.
