Skip to content

Radio

SRadioGroup is a group of radio buttons built on Reka UI (the radiogroup/radio roles, arrow key navigation). The group composes SRadio — a single option that reuses SLabel. Options are set with the options prop or with SRadio in the slot.

With options

Horizontal, with a slot

Disabled group

The disabled prop on SRadioGroup disables all options at once.

Required choice

The required prop makes a choice in the group required for form submission.

Color

The color prop on SRadio sets the color of the checked state from the palette.

Label, hint and error

label renders the group title and links it with aria-labelledby (a native <label for> does not work with a role="radiogroup" container — it has no value of its own). hint and error go below the group. No separate SFormField wrapper is needed for this; aria-label remains for cases without a visible title.

Choice card

SRadio can be built into a card where a click anywhere on the row selects the option. stretch stretches the radio button to the container width and gives the free space to the label, align="center" centers the circle against a multi-line label instead of the first line. The same props exist on SCheckbox.

Classes and attributes of SRadioGroup go to the field wrapper together with the title and hint. The layout of the options themselves is set with group-class — the class of the .s-radio-group container. The gap between options is the --s-radio-group-gap variable.

API

SRadio is a group option (reused inside SRadioGroup):

Props

NameTypeDefaultDescription
value*stringrequiredValue set on the group when this option is selected.
colorstringundefinedAccent color (checked state): a name from the palette (primary/teal/teal-10).
labelstringundefinedLabel text next to the radio (can be replaced with the default slot).
disabledbooleanundefinedDisables only this option.
align"start" | "center""start"Vertical alignment of the dot relative to the label: start aligns it with the first line, center with the middle of a multi-line label.
stretchbooleanundefinedStretches the radio to the container width, with the label taking the free space. A click anywhere on the row selects the option, which turns the component into a choice card.
idstringundefinedElement id. Generated automatically when not set (SSR-safe).

Slots

NameDescription
defaultLabel text (alternative to the label prop).

The group:

Props

NameTypeDefaultDescription
options{ label: string; value: string; disabled?: boolean }[]undefinedList of options. Alternatively, pass SRadio items in the default slot.
labelstringundefinedGroup title. Linked to the group via aria-labelledby.
hintstringundefinedHint below the group.
errorstringundefinedError message below the group. When set, the group is marked invalid.
invalidbooleanundefinedMarks the group invalid explicitly (in addition to error).
idstringundefinedGroup id. Generated automatically (SSR-safe) when not set.
orientation"vertical" | "horizontal""vertical"Layout orientation: vertical (default) or horizontal.
group-class | null | string | false | RecordundefinedClass of the options container (.s-radio-group). The component's own classes and attributes go to the field wrapper along with the title and hint, while the options layout lives here.
disabledbooleanundefinedDisables the whole group.
requiredbooleanundefinedSelection is required for form submission.
aria-labelstringundefinedAccessible name of the group when there is no visible label.
model-valuestringundefinedSelected value of the group. Two-way binding via v-model.

Events

NameSignatureDescription
update:modelValue(value: string | undefined) => voidEmitted when modelValue changes. Used for two-way binding (v-model).

Slots

NameDescription
defaultCustom set of SRadio items (instead of the options prop).
labelGroup title as markup, when a string label is not enough.