Radio Group
A single choice from a list.
MarkdownExamples
Basic
Plan
You can change it any time.
Horizontal
Size
Custom options
The option slot replaces each radio's content. Include radio-control to keep the circle.
Plan
API
| Prop | Type | Default |
|---|---|---|
optionsRadios to render, in order. | SelectOption<T>[] | [] |
labelVisible group label, which names the radiogroup. | string | — |
hintHelp text under the control, announced as its description. | string | — |
error
| string | boolean | — |
disabledDisables the control. | boolean | false |
orientationLayout hook, exposed as | "horizontal" | "vertical" | "vertical" |
nameForm field name: submits the value with a native form, via hidden inputs. | string | — |
idId for the control; generated with | string | — |
modelValueThe selected value. | T | — |
| Event | Payload |
|---|---|
update:modelValue
| [value: T | undefined] |
| Slot | Props |
|---|---|
optionRadio content, replacing the control and label. | { option: SelectOption<T>; checked: boolean; } |
Types
export interface SelectOption<T extends SelectValue = SelectValue> {
label: string;
value: T;
disabled?: boolean;
}
export type SelectValue = string | number;Copy codeStyling
- Parts
fieldfield-labelradio-groupradioradio-controlradio-labelfield-message- States
data-field-errordata-field-namedata-orientationdata-radio-checkeddata-field-tone
Keyboard
| Keys | Action |
|---|---|
Tab | Focus the selected radio |
| Arrow keys | Select the next / previous radio, wrapping |
Home / End | Select the first / last radio |
Accessibility
- In right-to-left layouts,
←/→follow the visual direction.