RadioGroup
Groups multiple Radio inputs under a single v-model with optional label, validation messages and SelectionControlGroup layout.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-radio-group> — 5 internal parts. The OrigamInput root ① wraps the group label ②, the SelectionControlGroup ③ with each Radio item ④ and the messages area ⑤.- 1.origam-radio-group
- Root element. Delegates to OrigamInput to manage label, error and messages.
- 2.origam-label (group label)
- Group-level label rendered via OrigamLabel with the label prop. Hidden when label is absent.
- 3.origam-selection-control-group
- Inner SelectionControlGroup wrapped in DefaultsProvider that propagates color, density and size to all child Radios.
- 4.origam-radio (per item)
- Each individual OrigamRadio rendered from the items array or the #item slot.
- 5.origam-messages
- Validation messages and hints area. Rendered by OrigamInput below the controls.
API
Props
All props accepted by this component, with their type, default value and description.
- idstring
- HTML id for the group root. Auto-generated as radio-group-{uid} when not provided.
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- activeboolean | IStateEffectConfig
- labelstring
- Group-level label rendered above the radio controls via OrigamLabel.
- size
- Size propagated to all Radio controls via DefaultsProvider.
- valueany
- disabledbooleanfalse
- Disables all radio inputs in the group.
- heightnumber | string
- widthnumber | string
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- focusedboolean
- valueComparator(a: any, b: any) => boolean
- messagesArray<string> | string
- color
- Intent or custom color propagated to all Radio controls in the group via DefaultsProvider.
- bgColor
- Background color propagated to all Radio controls.
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the group wrapper.
- borderColorstring
- Border-radius override for the group wrapper.
- elevationTElevation
- Box-shadow elevation token applied to the group root.
- paddingboolean | number | string
- Shorthand CSS padding applied to the group root.
- marginboolean | number | string
- Shorthand CSS margin applied to the group root.
- errorstring | boolean
- inlinebooleanfalse
- Renders the radio controls in a horizontal row instead of a vertical column.
- multipleboolean
- modelValueany
- Currently selected value. Bound with v-model. Updated when a Radio in the group is selected.
- errorMessagesArray<string> | string
- maxErrorsnumber | string
- namestring
- Name attribute propagated to all Radio inputs inside the group.
- readonlybooleanfalse
- Makes all radio inputs non-interactive without disabling them visually.
- rulesArray<any>
- validateOnTValidateOn
- validationValueany
- fontSizeTFontSize
- fontWeightTFontWeight
- lineHeightTLineHeight
- hintstring
- typestring
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- borderTopboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- hoverboolean | IStateEffectConfig
- Adjusts the vertical padding density of all Radio controls in the group.
- activeClassstring
- hoverClassstring
- centerAffixboolean
- hideDetailsboolean | string
- hideSpinButtonsboolean
- persistentHintboolean
- directionTDirection
- appendAvatarstring
- appendIconTIcon
- prependAvatarstring
- prependIconTIcon
- prependAriaLabelstring
- appendAriaLabelstring
- requiredbooleanfalse
- Marks the field as required and shows a required indicator on the label.
- falseIconTIcon
- trueIconTIcon
- rippleboolean | { class: string }
- itemsArray<any> | Record<string, any>[]
- Array of items passed to SelectionControlGroup. Each item is spread onto an OrigamRadio as props.
API
Slots
Content slots exposed by this component.
- #default
- Replaces the entire inner layout (label + controls + messages). Receives the Input context.
- #label
- Custom label replacing the default OrigamLabel above the group.
- #item
- Custom item template for each radio in the group. Replaces the default OrigamRadio per item.
API
Emits
Events emitted by this component.
- @update:modelValueany
- Emitted when the user selects a Radio in the group. Carries the selected value.
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to sub-components.
- Ref<string>
- Reactive CSS string generated by useStyle.
- ComputedRef<string>
- Computed group id (prop or auto-generated radio-group-{uid}).
- () => void
- Injects the computed style sheet. Called automatically on mount.
- () => void
- Removes the injected style sheet. Called automatically on unmount.
- Ref<boolean>
- True once the style sheet has been injected into the DOM.
- string
- Unique style-sheet ID for this instance.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Diameter of each circular radio input visual. Inherited from radio tokens.
- Border color of unchecked radio inputs.
- Fill color of the selected dot. Overridden by the color prop.
- Gap between radio items in the group.
- Density modifier: compact → -8px, comfortable → +8px.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| Space | Selects the focused Radio inside the group. |
| Tab | Moves focus to the next interactive element. |
| Arrow keys | Navigates between Radio options within the group. |
Notes
- The SelectionControlGroup is rendered with role="group". When a label is present, aria-labelledby is set to the label id so screen readers announce the group name.
- aria-describedby links the group to the messages/errors area rendered by OrigamInput below the controls.
- The disabled prop is propagated to all Radio inputs via DefaultsProvider. Each native input receives the disabled attribute.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Basic group
Inline layout
Custom item slot
Ecosystem
Family
Components from the same folder that share conventions and often compose together.