← All Components
<mth-tabs>
Accessible APG tabbed interface with RTL-aware roving focus, automatic/manual activation, and same-root ARIA linkage.
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-tabs>, or toggle Theme, Direction (LTR/RTL), or props above.
Live Variants & States Showcase
horizontal tabsTokens Primitives SSR W3C DTCG JSON compiled into adaptive OKLCH variables. Pure CSS layouts + shared reactive controllers. Declarative Shadow DOM streaming across 6 frameworks.
vertical + disabled tabActive Disabled Vertical keyboard navigation with ArrowUp / ArrowDown. Disabled panel
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/tabs"></script>
<mth-tabs activation="automatic" orientation="horizontal">Example</mth-tabs>import '@methane-ui/ui/tabs';
import '@methane-ui/react';
export function Example() {
return <mth-tabs activation="automatic" orientation="horizontal">Example</mth-tabs>;
}<script setup lang="ts">
import '@methane-ui/ui/tabs';
</script>
<template>
<mth-tabs activation="automatic" orientation="horizontal">Example</mth-tabs>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/tabs';
import { MthTabsDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthTabsDirective],
template: `<mth-tabs activation="automatic" orientation="horizontal">Example</mth-tabs>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/tabs';
import MthTabs from '@methane-ui/svelte/MthTabs.svelte';
</script>
<MthTabs activation="automatic" orientation="horizontal">Example</MthTabs>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Currently selected tab value. |
activation | activation | 'automatic' | 'manual' | "automatic" | Whether arrow-key focus immediately selects tabs (automatic) or requires Enter/Space (manual). |
orientation | orientation | 'horizontal' | 'vertical' | "horizontal" | Axis of tablist layout and arrow navigation (horizontal or vertical). |
label | label | string | "" | Accessible label for the internal tablist landmark. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-change | { value: string } | Emitted when the selected tab value changes. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | ltr | Horizontal tablist has focus | Moves focus to next enabled tab (and selects in automatic mode) |
| ArrowLeft | rtl | Horizontal tablist has focus in RTL | Moves focus to next enabled tab (and selects in automatic mode) |
| ArrowDown | both | Vertical tablist has focus | Moves focus to next enabled tab |
| ArrowUp | both | Vertical tablist has focus | Moves focus to previous enabled tab |
| Home | both | Any tab has focus | Moves focus to first enabled tab |
| End | both | Any tab has focus | Moves focus to last enabled tab |
| Enter | both | Tab is focused in manual activation mode | Selects focused tab and emits mth-change |
both | Tab is focused in manual activation mode | Selects focused tab and emits mth-change |
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" with host role="tablist". | 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-tabs.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(vertical). | Conformance suite |
| i18n | Routes 1 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |