Radio
Single-selection radio control with label, error and focus state support. Wraps OrigamRadioBtn inside OrigamInput.
Preview
Rendering the live preview…
defaultRendering the live preview…
checkedRendering the live preview…
successRendering the live preview…
dangerRendering the live preview…
disabledStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and 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
Content slots exposed by this component.
- #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
Events emitted by this component.
- @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
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 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.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- 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
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | 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.
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 usage
Colors & states
RadioGroup
Ecosystem
Family
Components from the same folder that share conventions and often compose together.