RadioGroup
Groups multiple Radio inputs under a single v-model with optional label, validation messages and SelectionControlGroup layout.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #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
Événements émis par ce composant.
- @update:modelValueany
- Emitted when the user selects a Radio in the group. Carries the selected value.
API
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <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.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
Interactions clavier
| Touche | 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.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic group
Inline layout
Custom item slot
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.