RadioGroup

Form & Input
stable

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.

Anatomy of OrigamRadioGroupSchematic of the RadioGroup component with 5 numbered internal parts. Label (group) Radio item 1 Radio item 2 messages / error 1 2 3 4 5
Anatomy of <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.

id
string
HTML id for the group root. Auto-generated as radio-group-{uid} when not provided.
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
active
boolean | IStateEffectConfig
label
string
Group-level label rendered above the radio controls via OrigamLabel.
Size propagated to all Radio controls via DefaultsProvider.
value
any
disabled
boolean
false
Disables all radio inputs in the group.
height
number | string
width
number | string
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
focused
boolean
valueComparator
(a: any, b: any) => boolean
messages
Array<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.
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
false
Applies a border to the group wrapper.
borderColor
string
Border-radius override for the group wrapper.
elevation
TElevation
Box-shadow elevation token applied to the group root.
padding
boolean | number | string
Shorthand CSS padding applied to the group root.
margin
boolean | number | string
Shorthand CSS margin applied to the group root.
error
string | boolean
inline
boolean
false
Renders the radio controls in a horizontal row instead of a vertical column.
multiple
boolean
modelValue
any
Currently selected value. Bound with v-model. Updated when a Radio in the group is selected.
errorMessages
Array<string> | string
maxErrors
number | string
name
string
Name attribute propagated to all Radio inputs inside the group.
readonly
boolean
false
Makes all radio inputs non-interactive without disabling them visually.
rules
Array<any>
validateOn
TValidateOn
validationValue
any
fontSize
TFontSize
fontWeight
TFontWeight
lineHeight
TLineHeight
hint
string
type
string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
borderTop
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
hover
boolean | IStateEffectConfig
density
'default'
Adjusts the vertical padding density of all Radio controls in the group.
activeClass
string
hoverClass
string
centerAffix
boolean
hideDetails
boolean | string
hideSpinButtons
boolean
persistentHint
boolean
direction
TDirection
appendAvatar
string
appendIcon
TIcon
prependAvatar
string
prependIcon
TIcon
prependAriaLabel
string
appendAriaLabel
string
required
boolean
false
Marks the field as required and shows a required indicator on the label.
falseIcon
TIcon
trueIcon
TIcon
ripple
boolean | { class: string }
items
Array<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:modelValue
any
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

radiogroup

Interactions clavier

Interactions clavier
ToucheAction
SpaceSelects the focused Radio inside the group.
TabMoves focus to the next interactive element.
Arrow keysNavigates 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

vue

Inline layout

vue

Custom item slot

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.