@methane-ui/ui~9.0 KB brotli (cold + Lit)~2.6 KB marginalWAI-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.
Multi-Framework Playground & Snippets
Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|
label | label | string | "" | Accessible label for the menubar. |
orientation | orientation | string | "horizontal" | Menubar axis orientation (horizontal or vertical). |
items | — | ReadonlyArray<unknown> | [] | Structured menubar triggers and nested dropdown items. |
Events
| Event | Detail Type | Description |
|---|
mth-select | { value: string; label: string; parentValue?: string; href?: string } | Fired when a leaf menubar or submenu item is activated. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|
| ArrowRight | both | horizontal menubar | moves focus to next menubar item (wraps, reverses in RTL) |
| ArrowLeft | both | horizontal menubar | moves focus to previous menubar item (wraps, reverses in RTL) |
| ArrowDown | both | focused on menubar item with submenu | opens dropdown menu and focuses first enabled submenu item |
| Escape | both | submenu open | closes submenu and returns focus to trigger |
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-menubar.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(open). | Conformance suite |
| i18n | Routes 1 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |