# Radio

> One choice out of a few, all on show. A 20px circle with a dot in the picked one, and the words beside it.

| | |
|---|---|
| Kind | component |
| Contract | `review` · [radio.contract.yaml](https://github.com/Runceanu/rost/blob/master/contracts/radio.contract.yaml) |
| Guidance | `proposed` |
| Source | [Figma 733:124](https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=733-124) · read 2026-11-16 · frozen 2026-11-16 |
| Implemented in | nowhere yet |

## Install

It lands in `src/rost/radio/`, with what it needs and its contract:

```sh
npx github:Runceanu/rost add radio
```

Then import `src/rost/fonts.css` and `src/rost/tokens.css` once, at the root of the app. More on this in [Install](https://rost.build/docs/install.md).

## Props

| Prop | Type | Values | Default |
|---|---|---|---|
| `checked` | boolean |  | `false` |
| `children` | slot |  |  |

## States

`Default` · `Hover` · `Pressed` · `Focus` · `Disabled`

## Anatomy

- `root`: A `<label>` around the input, the circle and the words, so a press anywhere on it counts. Hover and press come from the label.
- `input`: The real `<input type="radio">`, there for the keyboard, forms and screen readers, and hidden from sight. The circle draws what it says.
- `box`: The 20px circle. Empty it's the page's colour inside a field's edge. Picked it's filled with the primary green.
- `dot`: The 8px dot in the middle, in the colour of a primary button's label: 6px in from the edge.
- `focus-ring`: Around the circle, keeping its shape.
- `label`: The words. Paragraph type, in the colour SwitchField's label has. It doesn't change when it's picked: the circle says that.

## When to use

- **One out of a few.** Two to five choices where seeing them all helps you pick: how often to invoice, which currency.

## When not to use

- **Many choices.** More than five or six, or a list that changes. That's a select, and Rost doesn't have one yet.
- **Switching a view.** Picking which view the screen shows. That's **ToggleGroup** or **Tabs**.

## Behaviour

Put the radios of one question in a `<fieldset>` with a `<legend>` that asks it, and give them the same `name`. The browser does the rest: one picked at a time, and the arrow keys move between them. Empty is a field's edge around the page colour. Picked fills with the primary green, with a dark dot. Disabled fades the row.

## Accessibility

- **Element**: A real `<input type="radio">` inside a `<label>`. The input is hidden from sight, not from screen readers.
- **Name**: The words beside it. The `<legend>` names the group.
- **Keyboard**: Tab reaches the group, on the picked one. The arrow keys move the pick.
- **Focus**: `focus-ring` around the circle, on `:focus-visible`.
- **Colour**: Picked isn't only green: the dot is there too. Picked, the edge is the fill's green in dark and a dark green in light, so the circle stands out at 3:1 or more on both.

## Content

Short, parallel answers to the legend's question, in sentence case.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `font-family/base` | `'General Sans Variable'` |
| `opacity/gentle` | `0.24` |
| `radio/label` | `#d3d9d5` |
| `radio/off/default/box` | `#060805` |
| `radio/off/default/edge` | `#747573` |
| `radio/off/disabled/box` | `#060805` |
| `radio/off/disabled/edge` | `#747573` |
| `radio/off/focus/box` | `#060805` |
| `radio/off/focus/edge` | `#747573` |
| `radio/off/focus/focus-ring` | `#999` |
| `radio/off/hover/box` | `#171717` |
| `radio/off/hover/edge` | `#999999` |
| `radio/off/pressed/box` | `#171717` |
| `radio/off/pressed/edge` | `#999999` |
| `radio/on/default/box` | `#00d669` |
| `radio/on/default/dot` | `#060805` |
| `radio/on/disabled/box` | `#00d669` |
| `radio/on/disabled/dot` | `#060805` |
| `radio/on/edge` | `#00d669` |
| `radio/on/focus/box` | `#00d669` |
| `radio/on/focus/dot` | `#060805` |
| `radio/on/focus/focus-ring` | `#b6ffda` |
| `radio/on/hover/box` | `#00b450` |
| `radio/on/hover/dot` | `#060805` |
| `radio/on/pressed/box` | `#00913a` |
| `radio/on/pressed/dot` | `#060805` |
| `spacing/gap/small` | `8px` |
| `spacing/gap/xsmall` | `6px` |
| `spacing/outline/medium` | `2px` |
| `spacing/outline/small` | `1px` |
| `spacing/radius/full` | `10000px` |
| `spacing/size/xsmall` | `20px` |
| `typography/paragraph/font-size` | `14px` |
| `typography/paragraph/font-weight/regular` | `400` |
| `typography/paragraph/letter-spacing` | `0px` |
| `typography/paragraph/line-height` | `20px` |

## No token, on purpose

| Part | Property | Value | Why |
|---|---|---|---|
| `box` | `outline-offset` | `calc(-1 * var(--spacing-outline-small))` | Composed from a token: the edge sits inside the box. |
| `focus-ring` | `inset` | `calc(-1 * var(--spacing-gap-2xsmall))` | Composed from a token: the ring sits spacing/gap/2xsmall outside the circle. |

See it live, with every value of every variant: [rost.build/components/radio/](https://rost.build/components/radio/)
