Radio
Single-selection radio control with label, error and focus state support. Wraps OrigamRadioBtn inside OrigamInput.
Aperçu
Rendu de l’aperçu en cours…
defaultRendu de l’aperçu en cours…
checkedRendu de l’aperçu en cours…
successRendu de l’aperçu en cours…
dangerRendu de l’aperçu en cours…
disabledStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-radio> — 5 internal parts: the Input wrapper ①, the SelectionControl ②, the circular input ③, the selection dot ④, and the label ⑤.- 1.origam-radio
- Root element. Wraps OrigamInput providing messages, error and label orchestration.
- 2.origam-selection-control
- Inner SelectionControl hosting the ripple zone, the native input and the label.
- 3.origam-selection-control__input
- Circular input zone with the ripple directive. Contains the native .
- 4.origam-radio__dot (via MDI icon)
- Checked-state dot rendered by the trueIcon (mdi-radiobox-marked). Scales with size.
- 5.origam-selection-control__label
- Label container. Renders OrigamLabel with color and for wiring.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- idstring
- HTML id for the input element. Auto-generated if not provided.
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- centerAffixboolean
- hideDetailsboolean | string
- hideSpinButtonsboolean
- hintstring
- persistentHintboolean
- messagesArray<string> | string
- Adjusts the vertical padding density of the control wrapper.
- paddingboolean | number | string
- Shorthand CSS padding applied to the radio root.
- 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
- marginboolean | number | string
- Shorthand CSS margin applied to the radio root.
- 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
- Border-radius override for the radio control wrapper.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- color
- Intent or custom color applied to the checked state icon and dot.
- bgColorTColor
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the control wrapper.
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- elevationTElevation
- Box-shadow elevation token applied to the radio root.
- heightnumber | string
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- directionTDirection
- disabledbooleanfalse
- Disables the radio control. Sets aria-disabled and prevents interaction.
- errorstring | boolean
- errorMessagesArray<string> | string
- maxErrorsnumber | string
- namestring
- Name attribute passed to the underlying input for form grouping.
- readonlybooleanfalse
- Makes the radio non-interactive without disabling it visually.
- rulesArray<any>
- modelValueany
- Current selected value. Bound with v-model.
- validateOnTValidateOn
- validationValueany
- focusedboolean
- appendAvatarstring
- appendIconTIcon
- prependAvatarstring
- prependIconTIcon
- prependAriaLabelstring
- appendAriaLabelstring
- sizeTSize | number
- fontSizeTFontSize
- fontWeightTFontWeight
- lineHeightTLineHeight
- labelstring
- Label text rendered next to the radio control.
- trueValueany
- The value to set on the model when this radio is selected.
- falseValueany
- The value to set on the model when this radio is unchecked (rarely used for radios).
- valueany
- Value used when this radio is part of a group (RadioGroup). Replaces trueValue in group context.
- requiredbooleanfalse
- Marks the field as required and shows a required indicator on the label.
- typestring
- valueComparator(a: any, b: any) => boolean
- falseIconTIcon
- trueIconTIcon
- multipleboolean
- inlineboolean
- hoverboolean | IStateEffectConfig
- hoverClassstring
- rippleboolean | { class: string }
- activeboolean | IStateEffectConfigfalse
- Forces the control into its active/pressed visual state.
- activeClassstring
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Replaces the entire inner layout (RadioBtn + messages). Receives the input context.
- #input
- Custom input surface replacing the default radio icon. Receives all interaction props.
- #label
- Custom label content replacing the default OrigamLabel.
- #details
- Custom details area (hint, counter, error detail).
- #messages
- Custom messages/errors area below the control.
- #message
- #prepend
- Content prepended before the radio control.
- #append
- Content appended after the radio control.
API
Emits
Événements émis par ce composant.
- @update:modelValueany
- Emitted when the user selects this radio. Carries the trueValue (or value in group context).
- @update:focusedany
- @focusFocusEvent
- Fired when the radio input receives focus.
- @click:labelMouseEvent
- Fired when the user clicks the label area. Propagated from the inner OrigamRadioBtn.
- @blurFocusEvent
- Fired when the radio input loses focus.
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 from the computed radioStyles.
- string
- Computed input id (prop or auto-generated).
- () => 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 the circular radio input visual.
- Border color of the unchecked radio.
- Border color when the radio is checked.
- Border color when the radio is disabled.
- Diameter of the inner dot rendered when checked.
- Background color of the inner dot.
- Density modifier offset: 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 radio when focused. |
| Tab | Moves focus to the next interactive element. |
| Arrow keys (in group) | Navigates between radio options in a RadioGroup. |
Notes
- When disabled, aria-disabled="true" is set on the native input. Pointer events are suppressed via CSS.
- The label is associated with the input via the for/id pair managed by OrigamLabel. Clicking the label activates the control.
- RadioGroup sets aria-labelledby and aria-describedby on the group container for screen-reader announcements.
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 usage
Colors & states
RadioGroup
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.