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

<mth-menubar>

@methane-ui/ui~9.0 KB brotli (cold + Lit)~2.6 KB marginal

WAI-ARIA horizontal or vertical application menubar with roving focus, RTL awareness, and dropdown submenus.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/menubar"></script>
<mth-menubar orientation="horizontal">Example</mth-menubar>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
labellabelstring""Accessible label for the menubar.
orientationorientationstring"horizontal"Menubar axis orientation (horizontal or vertical).
items—ReadonlyArray<unknown>[]Structured menubar triggers and nested dropdown items.

Events

EventDetail TypeDescription
mth-select{ value: string; label: string; parentValue?: string; href?: string }Fired when a leaf menubar or submenu item is activated.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightbothhorizontal menubarmoves focus to next menubar item (wraps, reverses in RTL)
ArrowLeftbothhorizontal menubarmoves focus to previous menubar item (wraps, reverses in RTL)
ArrowDownbothfocused on menubar item with submenuopens dropdown menu and focuses first enabled submenu item
Escapebothsubmenu opencloses submenu and returns focus to trigger

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 4 APG keyboard transitions across LTR/RTL.mth-menubar.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(open).Conformance suite
i18nRoutes 1 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test