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

<mth-tabs>

@methane-ui/ui~10.1 KB brotli (cold + Lit)~3.2 KB marginal

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

Interactive StageLive Custom Element · <mth-tabs> (@methane-ui/ui)
OverviewTokensAccessibilitySpec-first Web Components with progressive enhancement and native top-layer overlays.Precision Atmospheric OKLCH ramps with automatic light, dark, and high-contrast modes.Same-root ARIA relationships, roving tabindex, and logical CSS direction flipping.
Ready · interact with <mth-tabs>, or toggle Theme, Direction (LTR/RTL), or props above.

Live Variants & States Showcase

horizontal tabsTokensPrimitivesSSRW3C DTCG JSON compiled into adaptive OKLCH variables.Pure CSS layouts + shared reactive controllers.Declarative Shadow DOM streaming across 6 frameworks.
vertical + disabled tabActiveDisabledVertical 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>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Currently selected tab value.
activationactivation'automatic' | 'manual'"automatic"Whether arrow-key focus immediately selects tabs (automatic) or requires Enter/Space (manual).
orientationorientation'horizontal' | 'vertical'"horizontal"Axis of tablist layout and arrow navigation (horizontal or vertical).
labellabelstring""Accessible label for the internal tablist landmark.

Events

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

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightltrHorizontal tablist has focusMoves focus to next enabled tab (and selects in automatic mode)
ArrowLeftrtlHorizontal tablist has focus in RTLMoves focus to next enabled tab (and selects in automatic mode)
ArrowDownbothVertical tablist has focusMoves focus to next enabled tab
ArrowUpbothVertical tablist has focusMoves focus to previous enabled tab
HomebothAny tab has focusMoves focus to first enabled tab
EndbothAny tab has focusMoves focus to last enabled tab
EnterbothTab is focused in manual activation modeSelects focused tab and emits mth-change
bothTab is focused in manual activation modeSelects focused tab and emits mth-change

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none" with host role="tablist".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-tabs.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(vertical).Conformance suite
i18nRoutes 1 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test