← All Components
<mth-tab>
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
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>import '@methane-ui/ui/tab';
import '@methane-ui/react';
export function Example() {
return <mth-tab>Example</mth-tab>;
}<script setup lang="ts">
import '@methane-ui/ui/tab';
</script>
<template>
<mth-tab>Example</mth-tab>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/tab';
import { MthTabDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthTabDirective],
template: `<mth-tab>Example</mth-tab>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/tab';
import MthTab from '@methane-ui/svelte/MthTab.svelte';
</script>
<MthTab>Example</MthTab>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Identifier matching the corresponding <mth-tab-panel> value. |
selected | selected | boolean | false | Marks this tab as the active selection. |
disabled | disabled | boolean | false | Prevents focus activation and selection. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Enter | both | Tab is focused and enabled inside mth-tabs | Activates this tab and selects its panel |
both | Tab is focused and enabled inside mth-tabs | Activates this tab and selects its panel |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="host" with host role="tab". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 2 APG keyboard transitions across LTR/RTL. | mth-tab.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(selected), :state(disabled). | Conformance suite |