Components
BaseRadioGroup
A group of radio buttons for one choice among a few options.
components/ui/inputs/BaseRadioGroup.vue
View in the demo
Example
API
Props
Name | Type | Default | Description |
|---|---|---|---|
itemsrequired | BaseSelectionItem[] | — | The options, each { title, value }. |
inline | boolean | true | Places the options in a row. Set it to false to stack them. |
mandatory | boolean | false | Prevents leaving the group without a choice. |
label | string | — | The visible label above the field, linked to it with for and aria-labelledby. |
input-id | string | — | A fixed id for the input. One is generated with useId() when you leave it out. |
optional | boolean | — | Adds “(optional)” after the label. Never mark required fields. |
info | BaseInputInfo | — | A help popover next to the label: a text or a list of { title, text }. |
v-model | BaseSelectionValue | null | null | The selected value. |
Events
Name | Payload | Description |
|---|---|---|
@update:modelValue | [value: BaseSelectionValue | null] | — |
Accessibility
With a label the group renders a fieldset with a legend, so screen readers announce the question before each option. It accepts rules, hint and error-messages like any field.