Radio Group
A radio group is a field control for choosing exactly one value from a short list of mutually exclusive options on the page — matching Figma Radio button Examples (group label + several radio inputs + validation copy).
Overview
Pass options (array of { value, label?, … }) and bind modelValue as a single selected value.
catnip-radio-group also provides:
- Field label (prop or
labelslot), required / optional markers,infotooltip supporting-textbelow the group (validation, hints)role="radiogroup"witharia-labelledby/aria-describedbywiring
Use a single catnip-radio when you only need one option rendered without a field group. Use catnip-dropdown for long lists in a compact panel.
Per-option errors
Set intent and supportingText on each options row for row-level validation. Set intent and supporting-text on the radio group for group-level copy. The live example shows Option A in danger with supporting text.
See Guidelines — Validation for a dynamic pattern.
Live example
Related
- Radio — Overview — one standalone option
- Inputs overview — shared label and supporting-text props
Guidelines
When to use
| Pattern | Use |
|---|---|
catnip-radio-group | Labelled single-select from an options array (Figma Radio button Examples). |
catnip-radio alone | Single option, or a row you place yourself outside a radio group. |
catnip-dropdown | Many options in a compact panel. |
Binding
<catnip-radio-group
label="Choose one"
required
intent="danger"
supporting-text="Resolve the option-level errors below."
.options="options"
.modelValue="selected"
@update:modelValue="selected = $event.detail[0] ?? $event.detail"
/>const selected = ref("a");
const options = ref([
{
value: "a",
label: "Option A",
intent: "danger",
supportingText: "Error message"
},
{ value: "b", label: "Option B" },
{ value: "c", label: "Option C" }
]);Bind .options and .modelValue on the host (see Component API). Toggling updates modelValue on the radio group host.
Validation (group + per option)
Use two levels:
| Level | Set on | Example |
|---|---|---|
| Group | catnip-radio-group → intent, supporting-text | “Select a valid option.” |
| Row | Each options[] item → intent, supportingText | “This option is currently unavailable.” |
Per-row intent is only neutral or danger (same as catnip-radio). Group intent also supports warning and success for the field supporting-text block.
Static row errors
Put intent and supportingText directly on the option object.
supportingText on an option accepts a string, string[], { text, intent?, icon? }, or an array of those objects. See supporting-text examples.