← All Components
<mth-radio-group>
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
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>import '@methane-ui/ui/radio-group';
import '@methane-ui/react';
export function Example() {
return <mth-radio-group orientation="horizontal">Example</mth-radio-group>;
}<script setup lang="ts">
import '@methane-ui/ui/radio-group';
</script>
<template>
<mth-radio-group orientation="horizontal">Example</mth-radio-group>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/radio-group';
import { MthRadioGroupDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthRadioGroupDirective],
template: `<mth-radio-group orientation="horizontal">Example</mth-radio-group>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/radio-group';
import MthRadioGroup from '@methane-ui/svelte/MthRadioGroup.svelte';
</script>
<MthRadioGroup orientation="horizontal">Example</MthRadioGroup>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Currently selected radio value. |
name | name | string | "" | Form submission field name. |
label | label | string | "" | Accessible group label rendered inside shadow root. |
hint | hint | string | "" | Helper text linked via aria-describedby inside shadow root. |
error | error | string | "" | Explicit custom error message displayed inside shadow root. |
orientation | orientation | 'horizontal' | 'vertical' | "vertical" | Layout and arrow navigation axis (horizontal | vertical). |
disabled | disabled | boolean | false | Disables all radios in the group. |
required | required | boolean | false | Marks selection required for constraint validation. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-change | { value: string } | Emitted when selected radio value changes. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowDown | both | vertical orientation | roves focus to next enabled radio and selects it |
| ArrowUp | both | vertical orientation | roves focus to previous enabled radio and selects it |
| ArrowRight | ltr | horizontal orientation in LTR | roves focus to next enabled radio and selects it |
| ArrowLeft | ltr | horizontal orientation in LTR | roves focus to previous enabled radio and selects it |
| ArrowLeft | rtl | horizontal orientation in RTL | roves focus to next enabled radio and selects it |
| ArrowRight | rtl | horizontal orientation in RTL | roves focus to previous enabled radio and selects it |
| Home | both | any orientation | moves focus and selection to first enabled radio |
| End | both | any orientation | moves focus and selection to last enabled radio |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 8 APG keyboard transitions across LTR/RTL. | mth-radio-group.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(dirty), :state(touched), :state(user-invalid), :state(disabled), :state(required). | Conformance suite |
| i18n | Routes 3 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |