Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-radio-group>

@methane-ui/ui~12.3 KB brotli (cold + Lit)~4.4 KB marginal

Form-associated radio group coordinating <mth-radio> children with APG roving focus, arrow selection, FACE validation, same-root ARIA, and FieldContext.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-radio-group> (@methane-ui/ui)
StableRelease CandidateCanary
Ready · interact with <mth-radio-group>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/radio-group"></script>
<mth-radio-group orientation="horizontal">Example</mth-radio-group>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Currently selected radio value.
namenamestring""Form submission field name.
labellabelstring""Accessible group label rendered inside shadow root.
hinthintstring""Helper text linked via aria-describedby inside shadow root.
errorerrorstring""Explicit custom error message displayed inside shadow root.
orientationorientation'horizontal' | 'vertical'"vertical"Layout and arrow navigation axis (horizontal | vertical).
disableddisabledbooleanfalseDisables all radios in the group.
requiredrequiredbooleanfalseMarks selection required for constraint validation.

Events

EventDetail TypeDescription
mth-change{ value: string }Emitted when selected radio value changes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowDownbothvertical orientationroves focus to next enabled radio and selects it
ArrowUpbothvertical orientationroves focus to previous enabled radio and selects it
ArrowRightltrhorizontal orientation in LTRroves focus to next enabled radio and selects it
ArrowLeftltrhorizontal orientation in LTRroves focus to previous enabled radio and selects it
ArrowLeftrtlhorizontal orientation in RTLroves focus to next enabled radio and selects it
ArrowRightrtlhorizontal orientation in RTLroves focus to previous enabled radio and selects it
Homebothany orientationmoves focus and selection to first enabled radio
Endbothany orientationmoves focus and selection to last enabled radio

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 8 APG keyboard transitions across LTR/RTL.mth-radio-group.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(dirty), :state(touched), :state(user-invalid), :state(disabled), :state(required).Conformance suite
i18nRoutes 3 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test