RadioBtn
Individual radio button control wrapping OrigamSelectionControl with type="radio" and animated dot icon.
Preview
Rendering the live preview…
uncheckedRendering the live preview…
checkedRendering the live preview…
disabledRendering the live preview…
errorStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and 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
Content slots exposed by this component.
- #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
Events emitted by this component.
- @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
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 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.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- 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
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | 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.
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 radio group
Colored radios
Ecosystem
Family
Components from the same folder that share conventions and often compose together.