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

<mth-tab>

@methane-ui/ui~6.8 KB brotli (cold + Lit)~1.4 KB marginal

Selectable tab trigger for <mth-tabs> implementing APG role="tab" semantics.

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-tab> (@methane-ui/ui)
OverviewTokens (Target)AccessibilitySpec-first Web Components.Precision Atmospheric OKLCH tokens.Same-root ARIA & roving focus.
Ready · interact with <mth-tab>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/tab"></script>
<mth-tab>Example</mth-tab>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Identifier matching the corresponding <mth-tab-panel> value.
selectedselectedbooleanfalseMarks this tab as the active selection.
disableddisabledbooleanfalsePrevents focus activation and selection.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EnterbothTab is focused and enabled inside mth-tabsActivates this tab and selects its panel
bothTab is focused and enabled inside mth-tabsActivates this tab and selects its panel

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="host" with host role="tab".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 2 APG keyboard transitions across LTR/RTL.mth-tab.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(selected), :state(disabled).Conformance suite