Design System

Radio ​

A radio picks one option out of a set where the options exclude each other and the whole set is worth showing at once. CRadio is one option rather than the set: a circle, a label, a value, and a model shared with the other options beside it.

The component is thin on purpose, with no size axis, no severity axis and no slots. What it does settle is the part that is easy to get wrong by hand: it always renders a <label> wired to the input, so the words are part of the control rather than text sitting near it.

This page explains the model. Usage shows how to build a set, and Reference lists the props, events and the markup it renders.

When a radio is the right control ​

QuestionYesNo
Does choosing one option unchoose the othersA radio or a selectA checkbox per option
Are the options worth reading side by sideA radioA select, which hides them until asked
Is the set short and settledA radioA select, which survives a list that grows

Three to five options is the band where a radio earns the vertical space it takes. Under three, a toggle or a segmented control says the same thing in one row. Over five, the set stops being scannable at a glance.

A radio also commits to holding an answer. Clicking the selected option again does not clear it, so a set that starts with nothing chosen needs a model that can hold a value none of the options carries.

What the component decides for you ​

An unchecked radio above a selected one, with the twenty pixel circle, the twelve pixel dot and the eight pixel gap to the label marked
One geometry, one gap, and a label that is part of the hit target.

The circle, the dot, the gap to the label and the caption role of the label are all fixed, and none of them is a prop. Geometry has the measurements.

The gap to the label is the one piece of spacing the component owns. The distance between options belongs to the parent, as space sets out, and the component holds the caller to it by refusing a class, the contract components describes.

An id is generated per instance and written to both the input and the label's for, so an accessible name exists without a caller writing one.

The set is not a group ​

A radio set holds together because the options share a model. Nothing in the markup says so.

No role="radiogroup" is written anywhere in the interface, so assistive technology meets a run of unrelated radios rather than one choice, and the heading above the set is ordinary text rather than its name.

The native half of grouping has to be asked for by giving every option the same name, which Usage covers. Seven of the eleven call sites in the interface leave it out.

States rather than variants ​

Five radios in a row showing the default, hover, focus-visible, checked and disabled states
Five painted states, and no axis to pick from.

There is no size prop and no severity prop. What the component varies over is state: checked against unchecked, enabled against disabled, with hover and keyboard focus painted over either. Colour by state lists what each one paints.

Disabled dims the label and fills the circle, the division of labour states sets out.

What the colours cost in dark mode ​

The checked circle measures 1.98 to 1 against the page in dark mode, and the unchecked border sits near 2 to 1 in both appearances. Both are under the 3 to 1 that a non-text identifier owes, which colour explains.

That is survivable in a settings panel, where the label carries the meaning. It is not survivable as the sole difference between two rows in a dense list, and colour covers the second signal such a case needs.

The focus ring comes from outside the preset ​

The preset writes no focus style for a radio at all, because the visible circle sits beside an input at zero opacity. A stylesheet in the interface draws the ring on the focused input's siblings instead, and theme owns that contract. Rendered outside that stylesheet, a radio has no visible focus indicator.

There is no invalid appearance ​

invalid is not a prop and is not forwarded, so the danger border the preset carries cannot be reached through CRadio. A message about a missing or wrong choice belongs beside the heading that names the set. Reference lists what else is dropped on the way in.