@methane-ui/ui~10.1 KB brotli (cold + Lit)~3.2 KB marginalMulti-column expandable navigation mega menu combining RovingFocusController triggers with OverlayController + PositioningController panels.
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 <nav> landmark. |
open | open | boolean | false | Whether the mega menu panel is open. |
openSection | open-section | string | "" | Active section ID currently displayed inside the panel. |
hoverDelay | hover-delay | number | 120 | Pointer hover intent delay in milliseconds before switching sections. |
forceFallback | force-fallback | boolean | false | Forces JS fallback positioning and non-top-layer overlay rendering. |
sections | — | ReadonlyArray<unknown> | [] | Structured top-level navigation sections and multi-column link groups. |
Events
| Event | Detail Type | Description |
|---|
mth-open | { sectionId: string } | Cancelable event fired before opening the panel. |
mth-after-open | void | Fired after the panel opens. |
mth-close | { reason: string } | Cancelable event fired before closing the panel. |
mth-after-close | { reason: string } | Fired after the panel closes. |
mth-select | { sectionId: string; href: string; label: string } | Fired when a link inside a column is clicked. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|
| ArrowRight | both | trigger bar focused | moves focus to next trigger |
| ArrowLeft | both | trigger bar focused | moves focus to previous trigger |
| ArrowDown | both | focused on expandable trigger | opens section panel |
| Escape | both | panel open | closes panel and restores 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-mega-menu.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(open). | Conformance suite |
| i18n | Routes 2 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |