RadioBtn
Individual radio button control wrapping OrigamSelectionControl with type="radio" and animated dot icon.
Aperçu
Rendu de l’aperçu en cours…
uncheckedRendu de l’aperçu en cours…
checkedRendu de l’aperçu en cours…
disabledRendu de l’aperçu en cours…
errorStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-radio-btn> — 4 internal parts: the selection-control root ①, the radio ring ②, the selection dot ③, and the label area ④.- 1.origam-radio-btn
- Root class applied to the OrigamSelectionControl wrapper. Delegates all rendering to the selection-control via filterProps.
- 2.origam-selection-control__input (ring)
- Circular ring. Border-color transitions from border.default → action.primary.bg when checked. 20 × 20 px, border-radius: full.
- 3.origam-selection-control__input (dot)
- Inner dot (10 × 10 px). Animates from scale(0) → scale(1) on check. Background-color: action.primary.bg.
- 4.origam-selection-control__label
- Label text area. Color: text.primary. Renders the label prop or #default slot.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- labelstring
- Text label rendered next to the radio button. Can also use the #default slot.
- trueValueany
- falseValueany
- valueany
- Value emitted when the radio is selected. Used for group comparison.
- requiredbooleanfalse
- Marks the underlying input as required.
- disabledbooleanfalse
- Disables the radio button. Sets aria-disabled and reduces opacity.
- errorstring | booleanfalse
- Applies error state styling (danger color) to the radio and label.
- namestring
- HTML name attribute forwarded to the underlying <input>. Used for native form grouping.
- readonlybooleanfalse
- Makes the radio non-interactive without applying disabled styling.
- typestring
- modelValueany
- Bound value. When modelValue equals value prop, the radio is checked.
- valueComparator(a: any, b: any) => boolean
- Icon shown when the radio is unchecked.
- Icon shown when the radio is checked.
- multiplebooleanfalse
- When true, uses array-based modelValue (not typical for radio).
- inlinebooleanfalse
- Renders the control inline (display: inline-flex) instead of block.
- color
- Active state color of the radio ring and dot. Defaults to primary via token.
- bgColorTColor
- hoverboolean | IStateEffectConfig
- hoverClassstring
- Adjusts padding density of the control.
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>
- 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
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- rippleboolean | { class: string }true
- Enables the Material ripple effect on click.
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Label content. Overrides the label prop.
- #input
- Custom input element slot. props contains the native input attributes, icon is the current icon, model is the reactive value.
- #label
- Custom label slot. Replaces the label text area.
API
Emits
Événements émis par ce composant.
- @update:modelValueany
- Fired when the radio is selected. Payload is the value prop.
- @click:labelMouseEvent
- Fired when the label text is clicked. Forwarded from OrigamSelectionControl.
- @focusFocusEvent
- Fired when the underlying input receives focus.
- @blurFocusEvent
- Fired when the underlying 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 SelectionControl.
- Ref<string>
- Reactive CSS string generated by useStyle.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet.
- () => void
- Removes the injected style sheet.
- Ref<boolean>
- True once the style sheet has been injected.
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.
- Width and height of the radio ring.
- Ring border color in unchecked state.
- Ring border color when checked.
- Ring border color when disabled.
- Ring border color in error state.
- Diameter of the inner selection dot.
- Background color of the inner dot when selected.
- Font size of the label text.
- Overall opacity of the control when disabled.
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 button when focused. |
| Tab | Moves focus to the next interactive element. |
| Arrow Up / Arrow Down | Navigates between radios in a group (native browser behaviour on <input type="radio">). |
Notes
- The underlying <input type="radio"> provides native radio behaviour: keyboard navigation, grouping via name, and correct role="radio" without any ARIA additions.
- The label is associated with the input via <label> — clicking the label text activates the radio.
- When disabled=true, the native disabled attribute is set on the input. No aria-disabled is needed.
- Error state applies visual styling only. Connect an aria-describedby to an error message element for full accessibility.
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 radio group
Colored radios
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.