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

<mth-navbar>

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

Landmark application header and navigation bar with brand/nav/actions slots and accessible mobile disclosure.

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-navbar> (@methane-ui/ui)
Methane UIDocsTokensKitsGet Started
Ready · interact with <mth-navbar>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

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

Properties & Attributes

PropertyAttributeTypeDefaultDescription
labellabelstring""Accessible label for the primary <nav> landmark.
openopenbooleanfalseControls visibility of the collapsible mobile disclosure drawer.
stickystickybooleanfalsePins the navbar to the top of the viewport (position: sticky).

Events

EventDetail TypeDescription
mth-open{ open: true }Cancelable event fired before opening the mobile drawer.
mth-close{ open: false; reason: string }Fired when the mobile drawer closes.
mth-change{ open: boolean }Fired whenever mobile drawer open state toggles.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EscapebothMobile disclosure drawer is openCloses mobile drawer and restores focus to toggle button

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 1 APG keyboard transitions across LTR/RTL.mth-navbar.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(open), :state(sticky).Conformance suite
i18nRoutes 3 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test