@methane-ui/ui~7.9 KB brotli (cold + Lit)~2.0 KB marginalMobile-friendly viewport bottom navigation bar with horizontal roving focus, aria-current="page", badges, and safe URL validation.
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-bottom-nav>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/bottom-nav"></script>
<mth-bottom-nav fixed></mth-bottom-nav>
import '@methane-ui/ui/bottom-nav';
import '@methane-ui/react';
export function Example() {
return <mth-bottom-nav fixed></mth-bottom-nav>;
}
<script setup lang="ts">
import '@methane-ui/ui/bottom-nav';
</script>
<template>
<mth-bottom-nav fixed></mth-bottom-nav>
</template>
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/bottom-nav';
import { MthBottomNavDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthBottomNavDirective],
template: `<mth-bottom-nav fixed></mth-bottom-nav>`,
})
export class ExampleComponent {}
<script lang="ts">
import '@methane-ui/ui/bottom-nav';
import MthBottomNav from '@methane-ui/svelte/MthBottomNav.svelte';
</script>
<MthBottomNav fixed></MthBottomNav>
Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|
label | label | string | "" | Accessible label for the <nav> landmark. |
activeValue | active-value | string | "" | Value of the currently active destination. |
activeHref | active-href | string | "" | Href of the currently active destination. |
fixed | fixed | boolean | true | Pins the bar to the bottom of the viewport via position: fixed. |
items | — | ReadonlyArray<unknown> | [] | Navigation destinations rendered in the bottom bar. |
Events
| Event | Detail Type | Description |
|---|
mth-select | { value: string; label: string; href?: string } | Fired when a bottom navigation item is activated. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|
| ArrowRight | ltr | item focused | moves focus to next enabled item |
| ArrowLeft | rtl | item focused | moves focus to next enabled item |
| Home | both | item focused | moves focus to first enabled item |
| End | both | item focused | moves focus to last enabled item |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 4 APG keyboard transitions across LTR/RTL. | mth-bottom-nav.spec.test.ts |
| i18n | Routes 1 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |