Radio Group
Size
A single-select radio group built on native <input type="radio"> items — the
browser provides roving tabindex, arrow navigation and form participation.
Import
Section titled “Import”<script> import RadioGroup from "@invisible-ui/svelte/RadioGroup.svelte";</script><script setup> import { RadioGroup } from "@invisible-ui/vue";</script>import { RadioGroup } from "@invisible-ui/react";<script type="module"> import "@invisible-ui/elements/define";</script>
<ds-radio-group></ds-radio-group>| Prop | Type | Default | Description |
|---|---|---|---|
items * | RadioGroupItem[] | — | |
value | string | null | null | |
disabled | boolean | false | |
orientation | Orientation | "vertical" | Layout direction. |
label * | string | — | Accessible name for the group. |
name | string | undefined | undefined | Form field name — the selected value is submitted under it (auto-generated for grouping if omitted). |
onValueChange | ((value: string) => void) | undefined | undefined | Called whenever the selected value changes. |
| Prop | Type | Default | Description |
|---|---|---|---|
items * | RadioGroupItem[] | — | |
modelValue | string | null | undefined | v-model value; takes precedence over value when bound. |
value | string | null | null | |
disabled | boolean | false | |
orientation | RadioGroupOrientation | "vertical" | Layout and arrow-key axis. Defaults to vertical. |
label * | string | — | Accessible name for the group (announced by screen readers). |
name | string | undefined | Form field name; the selected value is submitted under it. |
onValueChange | (value: string) => void | undefined | Called whenever the selected value changes. |
| Event | Payload |
|---|---|
update:modelValue | value: string | null |
| Prop | Type | Default | Description |
|---|---|---|---|
items * | RadioGroupItem[] | — | |
value | string | null | null | Initial (uncontrolled) or current (controlled) selected value. |
disabled | boolean | false | |
orientation | RadioGroupOrientation | "vertical" | Layout and arrow-key axis. Defaults to vertical. |
label * | string | — | Accessible name for the group (announced by screen readers). |
name | string | — | Form field name; the selected value is submitted under it. |
onValueChange | (value: string) => void | — | Called whenever the selected value changes. |
| Attribute | Reactive | Description |
|---|---|---|
label * | yes | |
value | yes | |
name | yes | generated when absent, so the radios still form one group |
orientation | yes | |
disabled | yes | |
description | yes | |
error | yes |
Reactive attributes re-render the element when they change after the first render.
Properties: value, items.
Emits: bubbling change CustomEvent with detail.value.
Accessibility
Section titled “Accessibility”- Native radio pattern: the browser handles roving tabindex, arrow/Home/End navigation, selection-follows-focus and form submission.
role="radiogroup"with an accessiblelabel; each item exposesdata-statefor styling.
Example
Section titled “Example”<RadioGroup label="Plan" value="pro" items={[ { value: "free", label: "Free" }, { value: "pro", label: "Pro" }, ]} onValueChange={(v) => (plan = v)}/>In React, value works controlled or uncontrolled. onValueChange reports
what the user chooses; a changed value reports nothing:
<RadioGroup label="Plan" value={plan} items={[ { value: "free", label: "Free" }, { value: "pro", label: "Pro" }, ]} onValueChange={setPlan}/>Themeable via --ds-radio-*.