4.2.0
Core

RadioGroup

One choice from a small, fully visible set.

Default

One choice from a small, visible set. More than about seven options wants a Select.

Usage

import { RadioGroup, RadioGroupItem } from '@oceanic-hub/brand-system'
<RadioGroup>
  <RadioGroupItem value="…">…</RadioGroupItem>
</RadioGroup>

Composition

Use the following composition to build a RadioGroup:

RadioGroup
└── RadioGroupItem ×3

Radios when seeing all the options is part of the decision — an autonomy level, a billing plan. Past about seven options the set stops being scannable and wants a Select. One answer from the set is the whole shape: when the options are independent and any number of them may be true, that is a run of Checkboxes inside a FieldSet instead.

There is no RadioGroupIndicator: the filled brand dot is baked into the item, so a radio cannot be restyled into something that does not look like one. An item's selectedness is never a prop of its own — the group's value matching the item's value is the whole state, and checked is typed off the item on purpose (@OCE-1751) so a call site that tries to set one directly cannot compile.

Grouping a radio set with a legend, a description, or turning each option into a selectable card is Field's job, not this component's — see its "Radio group" and "Choice card" sections for the composed shape. This page's own scope is the control alone.

disabled on the group switches off every item at once; on a single RadioGroupItem it disables just that option, which is how a plan tier that is temporarily unavailable stays visible without being selectable.

Invalid is a solid stuck border, and it is stated twice. aria-invalid on the control paints it — that is the attribute assistive technology already reads — and a Field marked data-invalid paints it too, so a surface that wires only one of the two still draws the line (@OCE-1877). Neither is the whole message: FieldError carries the sentence, in ink beside a stuck mark, because a border can say that something is wrong and never what. Field's page shows the line drawn on every control at once.

RTL is not supported — recorded in pairings.json under direction: nothing in this package has ever been laid out or measured right-to-left, and upstream ships an RTL example.

Disabled

disabled on the group switches off every item at once; on a single RadioGroupItem it disables just that option, which is how a plan tier that is temporarily unavailable stays visible without being selectable.

API Reference

See the RadioGroup API page for every prop of every part, with types, defaults and the contract that pins them.

On this page