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

<mth-mega-menu>

@methane-ui/ui~10.1 KB brotli (cold + Lit)~3.2 KB marginal

Multi-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.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-mega-menu> (@methane-ui/ui)
Ready · interact with <mth-mega-menu>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/mega-menu"></script>
<mth-mega-menu hover-delay="120">Example</mth-mega-menu>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
labellabelstring""Accessible label for the <nav> landmark.
openopenbooleanfalseWhether the mega menu panel is open.
openSectionopen-sectionstring""Active section ID currently displayed inside the panel.
hoverDelayhover-delaynumber120Pointer hover intent delay in milliseconds before switching sections.
forceFallbackforce-fallbackbooleanfalseForces JS fallback positioning and non-top-layer overlay rendering.
sections—ReadonlyArray<unknown>[]Structured top-level navigation sections and multi-column link groups.

Events

EventDetail TypeDescription
mth-open{ sectionId: string }Cancelable event fired before opening the panel.
mth-after-openvoidFired 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

KeyDirectionWhenExpected Behavior
ArrowRightbothtrigger bar focusedmoves focus to next trigger
ArrowLeftbothtrigger bar focusedmoves focus to previous trigger
ArrowDownbothfocused on expandable triggeropens section panel
Escapebothpanel opencloses panel and restores 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-mega-menu.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(open).Conformance suite
i18nRoutes 2 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test