Navigationduskmoonimplemented1 demos

Megamenu

Megamenu groups navigation links in browser-managed popover panels.

Import@duskmoon-dev/components/megamenu
10API sections
17documented props
1behavior scenarios
Key API
triggerpanelHeadingpanelmobileleadingfullWidth

Usage

When to use

  • Use it when users need to move between sections, pages, steps, or contextual actions.
  • Expose current and disabled state so navigation remains clear to keyboard and screen-reader users.

Implementation notes

StylesheetImport @duskmoon-dev/components/styles.css once in the app or docs shell.
StateStart with default props for static examples, then switch to controlled props when state must be shared.
ThemeThe preview inherits the active DuskMoon data-theme value from the docs layout.

Features

Wayfinding

Covers the route, section, step, or action-list patterns that help users move through an interface.

Current state

Shows selected, active, open, or current props where the component exposes them.

Primary API surface

Megamenu is most often configured through `trigger`, `panelHeading`, `panel`, `mobile`.

Covered behavior

Gives each native popover pair a unique ID and CSS anchor

Feature Demos

Feature demos are authored for the component page, then supplemented with behavior scenarios from the component test coverage.

Preview

Selected destination: None

Interactive usage

authored

Each trigger opens its own native popover; Escape and light dismissal are browser-managed.

Source
import "@duskmoon-dev/components/styles.css";
import { Megamenu } from "@duskmoon-dev/components/megamenu";

export function MegamenuDemo() {
  return <Megamenu aria-label="Product navigation">
    <Megamenu.Bar>
      <Megamenu.Item>
        <Megamenu.Trigger>Products</Megamenu.Trigger>
        <Megamenu.Panel>
          <Megamenu.Heading>Products</Megamenu.Heading>
          <Megamenu.Grid><Megamenu.Group>
            <a className="link" href="#components">Components</a>
          </Megamenu.Group></Megamenu.Grid>
        </Megamenu.Panel>
      </Megamenu.Item>
      <li><a className="link" href="#components">All products</a></li>
    </Megamenu.Bar>
    <Megamenu.Mobile summary="Products">
      <a className="link" href="#components">Components</a>
    </Megamenu.Mobile>
  </Megamenu>;
}

API

The API reference below lists every parsed exported type or interface for Megamenu. Start with `trigger`, `panelHeading`, `panel`, `mobile` for common usage.

Types: packages/components/src/components/megamenu/Megamenu.types.tsScenarios: packages/components/src/components/megamenu/Megamenu.test.tsx
MegamenuPropsinterface extends Omit<ComponentProps<"nav">, "ref">
PropTypeRequiredDescription
triggerReactNodeNotrigger configures Megamenu.
panelHeadingReactNodeNopanelHeading configures Megamenu.
panelReactNodeNopanel configures Megamenu.
mobileReactNodeNomobile configures Megamenu.
leadingReactNodeNoleading configures Megamenu.
fullWidthbooleanNofullWidth configures Megamenu.
MegamenuPanelPropsinterface extends Omit<ComponentProps<"div">, "ref">
PropTypeRequiredDescription
fullbooleanNofull configures Megamenu.
MegamenuMobilePropsinterface extends Omit< ComponentProps<"details">, "ref" >
PropTypeRequiredDescription
summaryReactNodeYessummary configures Megamenu.
MegamenuComponentinterface extends ForwardRefExoticComponent< MegamenuProps & RefAttributes<HTMLElement> >
PropTypeRequiredDescription
BarForwardRefExoticComponent<YesBar configures Megamenu.
ItemForwardRefExoticComponent<YesItem configures Megamenu.
TriggerForwardRefExoticComponent<YesTrigger configures Megamenu.
PanelForwardRefExoticComponent<YesPanel configures Megamenu.
GridForwardRefExoticComponent<YesGrid configures Megamenu.
GroupForwardRefExoticComponent<YesGroup configures Megamenu.
HeadingForwardRefExoticComponent<YesHeading configures Megamenu.
SupportingForwardRefExoticComponent<YesSupporting configures Megamenu.
MobileForwardRefExoticComponent<YesMobile configures Megamenu.
MegamenuBarPropstype
Type definition
Omit<ComponentProps<"ul">, "ref">
MegamenuItemPropstype
Type definition
Omit<ComponentProps<"li">, "ref">
MegamenuTriggerPropstype
Type definition
Omit<ComponentProps<"button">, "ref">
MegamenuGroupPropstype
Type definition
Omit<ComponentProps<"section">, "ref">
MegamenuHeadingPropstype
Type definition
Omit<ComponentProps<"h2">, "ref">
MegamenuSupportingPropstype
Type definition
Omit<ComponentProps<"p">, "ref">