WRNexus UI
Navigation component

Mega Menu

Theme-aware, responsive mega menu component.

21 props1 slots4 outputsTheme readyResponsive
Interactive playground

Configure Mega Menu

Change any prop and inspect the server-rendered component immediately.

Live preview
Component code
page MegaMenuExample {
  state columns = [
  {
    "id": "mega-menu-0-1",
    "key": "mega-menu-0-1",
    "value": "primary",
    "label": "Primary workflow",
    "title": "Primary workflow",
    "description": "A clean default configuration for everyday product interfaces.",
    "text": "A configurable sample message.",
    "href": "#mega-menu-demo",
    "actionHref": "#mega-menu-demo",
    "actionLabel": "View details",
    "icon": "icon-[lucide--sparkles]",
    "iconClass": "icon-[lucide--sparkles]",
    "variant": "primary",
    "status": "Active",
    "time": "09:30",
    "current": true,
    "selected": true,
    "checked": true,
    "disabled": false,
    "outgoing": false,
    "open": true,
    "number": 1,
    "count": 16,
    "percentage": 72,
    "color": "#7c3aed",
    "target": "_self",
    "ariaLabel": "Open primary workflow 1",
    "items": [
      {
        "label": "Nested option A",
        "value": "nested-a"
      },
      {
        "label": "Nested option B",
        "value": "nested-b"
      }
    ],
    "links": [
      {
        "label": "Documentation",
        "href": "#documentation"
      },
      {
        "label": "API reference",
        "href": "#api-reference"
      }
    ],
    "values": [
      "Included",
      "Standard"
    ]
  },
  {
    "id": "mega-menu-0-2",
    "key": "mega-menu-0-2",
    "value": "secondary",
    "label": "Additional option",
    "title": "Supporting example",
    "description": "A clean default configuration for everyday product interfaces.",
    "text": "Another configurable message.",
    "href": "#mega-menu-demo",
    "actionHref": "#mega-menu-demo",
    "actionLabel": "View details",
    "icon": "icon-[lucide--sparkles]",
    "iconClass": "icon-[lucide--sparkles]",
    "variant": "primary",
    "status": "Active",
    "time": "09:30",
    "current": false,
    "selected": false,
    "checked": false,
    "disabled": false,
    "outgoing": true,
    "open": true,
    "number": 2,
    "count": 32,
    "percentage": 72,
    "color": "#7c3aed",
    "target": "_self",
    "ariaLabel": "Open primary workflow 2",
    "items": [
      {
        "label": "Nested option A",
        "value": "nested-a"
      },
      {
        "label": "Nested option B",
        "value": "nested-b"
      }
    ],
    "links": [
      {
        "label": "Documentation",
        "href": "#documentation"
      },
      {
        "label": "API reference",
        "href": "#api-reference"
      }
    ],
    "values": [
      "Included",
      "Standard"
    ]
  }
]
  state rail = [
  {
    "id": "mega-menu-0-1",
    "key": "mega-menu-0-1",
    "value": "primary",
    "label": "Primary workflow",
    "title": "Primary workflow",
    "description": "A clean default configuration for everyday product interfaces.",
    "text": "A configurable sample message.",
    "href": "#mega-menu-demo",
    "actionHref": "#mega-menu-demo",
    "actionLabel": "View details",
    "icon": "icon-[lucide--sparkles]",
    "iconClass": "icon-[lucide--sparkles]",
    "variant": "primary",
    "status": "Active",
    "time": "09:30",
    "current": true,
    "selected": true,
    "checked": true,
    "disabled": false,
    "outgoing": false,
    "open": true,
    "number": 1,
    "count": 16,
    "percentage": 72,
    "color": "#7c3aed",
    "target": "_self",
    "ariaLabel": "Open primary workflow 1",
    "items": [
      {
        "label": "Nested option A",
        "value": "nested-a"
      },
      {
        "label": "Nested option B",
        "value": "nested-b"
      }
    ],
    "links": [
      {
        "label": "Documentation",
        "href": "#documentation"
      },
      {
        "label": "API reference",
        "href": "#api-reference"
      }
    ],
    "values": [
      "Included",
      "Standard"
    ]
  },
  {
    "id": "mega-menu-0-2",
    "key": "mega-menu-0-2",
    "value": "secondary",
    "label": "Additional option",
    "title": "Supporting example",
    "description": "A clean default configuration for everyday product interfaces.",
    "text": "Another configurable message.",
    "href": "#mega-menu-demo",
    "actionHref": "#mega-menu-demo",
    "actionLabel": "View details",
    "icon": "icon-[lucide--sparkles]",
    "iconClass": "icon-[lucide--sparkles]",
    "variant": "primary",
    "status": "Active",
    "time": "09:30",
    "current": false,
    "selected": false,
    "checked": false,
    "disabled": false,
    "outgoing": true,
    "open": true,
    "number": 2,
    "count": 32,
    "percentage": 72,
    "color": "#7c3aed",
    "target": "_self",
    "ariaLabel": "Open primary workflow 2",
    "items": [
      {
        "label": "Nested option A",
        "value": "nested-a"
      },
      {
        "label": "Nested option B",
        "value": "nested-b"
      }
    ],
    "links": [
      {
        "label": "Documentation",
        "href": "#documentation"
      },
      {
        "label": "API reference",
        "href": "#api-reference"
      }
    ],
    "values": [
      "Included",
      "Standard"
    ]
  }
]
  view {
    <MegaMenu
      label="Mega Menu"
      columns="{columns}"
      rail="{rail}"
      featured='{
        "id": "mega-menu-0-1",
        "key": "mega-menu-0-1",
        "value": "primary",
        "label": "Primary workflow",
        "title": "Primary workflow",
        "description": "A clean default configuration for everyday product interfaces.",
        "text": "A configurable sample message.",
        "href": "#mega-menu-demo",
        "actionHref": "#mega-menu-demo",
        "actionLabel": "View details",
        "icon": "icon-[lucide--sparkles]",
        "iconClass": "icon-[lucide--sparkles]",
        "variant": "primary",
        "status": "Active",
        "time": "09:30",
        "current": true,
        "selected": true,
        "checked": true,
        "disabled": false,
        "outgoing": false,
        "open": true,
        "number": 1,
        "count": 16,
        "percentage": 72,
        "color": "#7c3aed",
        "target": "_self",
        "ariaLabel": "Open primary workflow 1",
        "items": [
          {
            "label": "Nested option A",
            "value": "nested-a"
          },
          {
            "label": "Nested option B",
            "value": "nested-b"
          }
        ],
        "links": [
          {
            "label": "Documentation",
            "href": "#documentation"
          },
          {
            "label": "API reference",
            "href": "#api-reference"
          }
        ],
        "values": [
          "Included",
          "Standard"
        ]
      }'
      columnCount="3"
      actionLabel="Mega Menu"
      actionHref="#mega-menu-demo"
    />
  }
}
Event outputInteract with the preview to inspect the typed payload.
Component props21 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Recommended

Grouped columns

One level deep by design: a mega menu shows breadth flat so everything is one click away. Nesting inside the panel would bury content behind hover-within-hover. Use Nav when you want cascading submenus.

01
Component usage.wrn
page MegaMenuExample {
  state columns = [
  {
    "heading": "Platform",
    "items": [
      {
        "label": "Runtime",
        "href": "/runtime",
        "description": "The browser half of the framework."
      },
      {
        "label": "Compiler",
        "href": "/compiler",
        "description": "WRN to JavaScript."
      }
    ]
  },
  {
    "heading": "Tooling",
    "items": [
      {
        "label": "CLI",
        "href": "/cli",
        "description": "Scaffold, build and deploy."
      },
      {
        "label": "Editor",
        "href": "/editor",
        "description": "Language server and syntax."
      }
    ]
  }
]
  state rail = [
  {
    "id": "mega-menu-0-1",
    "key": "mega-menu-0-1",
    "value": "primary",
    "label": "Primary workflow",
    "title": "Primary workflow",
    "description": "A clean default configuration for everyday product interfaces.",
    "text": "A configurable sample message.",
    "href": "#mega-menu-demo",
    "actionHref": "#mega-menu-demo",
    "actionLabel": "View details",
    "icon": "icon-[lucide--sparkles]",
    "iconClass": "icon-[lucide--sparkles]",
    "variant": "primary",
    "status": "Active",
    "time": "09:30",
    "current": true,
    "selected": true,
    "checked": true,
    "disabled": false,
    "outgoing": false,
    "open": true,
    "number": 1,
    "count": 16,
    "percentage": 72,
    "color": "#7c3aed",
    "target": "_self",
    "ariaLabel": "Open primary workflow 1",
    "items": [
      {
        "label": "Nested option A",
        "value": "nested-a"
      },
      {
        "label": "Nested option B",
        "value": "nested-b"
      }
    ],
    "links": [
      {
        "label": "Documentation",
        "href": "#documentation"
      },
      {
        "label": "API reference",
        "href": "#api-reference"
      }
    ],
    "values": [
      "Included",
      "Standard"
    ]
  },
  {
    "id": "mega-menu-0-2",
    "key": "mega-menu-0-2",
    "value": "secondary",
    "label": "Additional option",
    "title": "Supporting example",
    "description": "A clean default configuration for everyday product interfaces.",
    "text": "Another configurable message.",
    "href": "#mega-menu-demo",
    "actionHref": "#mega-menu-demo",
    "actionLabel": "View details",
    "icon": "icon-[lucide--sparkles]",
    "iconClass": "icon-[lucide--sparkles]",
    "variant": "primary",
    "status": "Active",
    "time": "09:30",
    "current": false,
    "selected": false,
    "checked": false,
    "disabled": false,
    "outgoing": true,
    "open": true,
    "number": 2,
    "count": 32,
    "percentage": 72,
    "color": "#7c3aed",
    "target": "_self",
    "ariaLabel": "Open primary workflow 2",
    "items": [
      {
        "label": "Nested option A",
        "value": "nested-a"
      },
      {
        "label": "Nested option B",
        "value": "nested-b"
      }
    ],
    "links": [
      {
        "label": "Documentation",
        "href": "#documentation"
      },
      {
        "label": "API reference",
        "href": "#api-reference"
      }
    ],
    "values": [
      "Included",
      "Standard"
    ]
  }
]
  view {
    <MegaMenu
      label="Products"
      icon="icon-[lucide--box]"
      columns="{columns}"
      rail="{rail}"
      featured='{
        "id": "mega-menu-0-1",
        "key": "mega-menu-0-1",
        "value": "primary",
        "label": "Primary workflow",
        "title": "Primary workflow",
        "description": "A clean default configuration for everyday product interfaces.",
        "text": "A configurable sample message.",
        "href": "#mega-menu-demo",
        "actionHref": "#mega-menu-demo",
        "actionLabel": "View details",
        "icon": "icon-[lucide--sparkles]",
        "iconClass": "icon-[lucide--sparkles]",
        "variant": "primary",
        "status": "Active",
        "time": "09:30",
        "current": true,
        "selected": true,
        "checked": true,
        "disabled": false,
        "outgoing": false,
        "open": true,
        "number": 1,
        "count": 16,
        "percentage": 72,
        "color": "#7c3aed",
        "target": "_self",
        "ariaLabel": "Open primary workflow 1",
        "items": [
          {
            "label": "Nested option A",
            "value": "nested-a"
          },
          {
            "label": "Nested option B",
            "value": "nested-b"
          }
        ],
        "links": [
          {
            "label": "Documentation",
            "href": "#documentation"
          },
          {
            "label": "API reference",
            "href": "#api-reference"
          }
        ],
        "values": [
          "Included",
          "Standard"
        ]
      }'
      columnCount="3"
      actionLabel="Mega Menu"
      actionHref="#mega-menu-demo"
    />
  }
}
Advanced

With a footer note

The panel is anchored, so the runtime clamp pulls it back inside the viewport instead of letting it hang off a wide layout. On a phone it stops floating and joins the flow.

02
Component usage.wrn
page MegaMenuExample {
  state columns = [
  {
    "heading": "By team",
    "items": [
      {
        "label": "Engineering",
        "href": "/eng",
        "icon": "icon-[lucide--code]"
      },
      {
        "label": "Design",
        "href": "/design",
        "icon": "icon-[lucide--palette]"
      },
      {
        "label": "Support",
        "href": "/support",
        "icon": "icon-[lucide--life-buoy]"
      }
    ]
  },
  {
    "heading": "By size",
    "items": [
      {
        "label": "Startup",
        "href": "/startup"
      },
      {
        "label": "Enterprise",
        "href": "/enterprise"
      }
    ]
  }
]
  state rail = [
  {
    "id": "mega-menu-1-1",
    "key": "mega-menu-1-1",
    "value": "primary",
    "label": "Secondary workflow",
    "title": "Secondary workflow",
    "description": "A compact configuration designed for dense application layouts.",
    "text": "A configurable sample message.",
    "href": "#mega-menu-demo",
    "actionHref": "#mega-menu-demo",
    "actionLabel": "View details",
    "icon": "icon-[lucide--zap]",
    "iconClass": "icon-[lucide--zap]",
    "variant": "secondary",
    "status": "Active",
    "time": "10:15",
    "current": true,
    "selected": true,
    "checked": true,
    "disabled": false,
    "outgoing": false,
    "open": true,
    "number": 1,
    "count": 24,
    "percentage": 48,
    "color": "#0284c7",
    "target": "_self",
    "ariaLabel": "Open secondary workflow 1",
    "items": [
      {
        "label": "Nested option A",
        "value": "nested-a"
      },
      {
        "label": "Nested option B",
        "value": "nested-b"
      }
    ],
    "links": [
      {
        "label": "Documentation",
        "href": "#documentation"
      },
      {
        "label": "API reference",
        "href": "#api-reference"
      }
    ],
    "values": [
      "Included",
      "Standard"
    ]
  },
  {
    "id": "mega-menu-1-2",
    "key": "mega-menu-1-2",
    "value": "secondary",
    "label": "Additional option",
    "title": "Supporting example",
    "description": "A compact configuration designed for dense application layouts.",
    "text": "Another configurable message.",
    "href": "#mega-menu-demo",
    "actionHref": "#mega-menu-demo",
    "actionLabel": "View details",
    "icon": "icon-[lucide--zap]",
    "iconClass": "icon-[lucide--zap]",
    "variant": "secondary",
    "status": "Active",
    "time": "10:15",
    "current": false,
    "selected": false,
    "checked": false,
    "disabled": false,
    "outgoing": true,
    "open": true,
    "number": 2,
    "count": 48,
    "percentage": 48,
    "color": "#0284c7",
    "target": "_self",
    "ariaLabel": "Open secondary workflow 2",
    "items": [
      {
        "label": "Nested option A",
        "value": "nested-a"
      },
      {
        "label": "Nested option B",
        "value": "nested-b"
      }
    ],
    "links": [
      {
        "label": "Documentation",
        "href": "#documentation"
      },
      {
        "label": "API reference",
        "href": "#api-reference"
      }
    ],
    "values": [
      "Included",
      "Standard"
    ]
  }
]
  view {
    <MegaMenu
      size="sm"
      label="Solutions"
      icon="icon-[lucide--arrow-right]"
      columns="{columns}"
      rail="{rail}"
      featured='{
        "id": "mega-menu-1-1",
        "key": "mega-menu-1-1",
        "value": "primary",
        "label": "Secondary workflow",
        "title": "Secondary workflow",
        "description": "A compact configuration designed for dense application layouts.",
        "text": "A configurable sample message.",
        "href": "#mega-menu-demo",
        "actionHref": "#mega-menu-demo",
        "actionLabel": "View details",
        "icon": "icon-[lucide--zap]",
        "iconClass": "icon-[lucide--zap]",
        "variant": "secondary",
        "status": "Active",
        "time": "10:15",
        "current": true,
        "selected": true,
        "checked": true,
        "disabled": false,
        "outgoing": false,
        "open": true,
        "number": 1,
        "count": 24,
        "percentage": 48,
        "color": "#0284c7",
        "target": "_self",
        "ariaLabel": "Open secondary workflow 1",
        "items": [
          {
            "label": "Nested option A",
            "value": "nested-a"
          },
          {
            "label": "Nested option B",
            "value": "nested-b"
          }
        ],
        "links": [
          {
            "label": "Documentation",
            "href": "#documentation"
          },
          {
            "label": "API reference",
            "href": "#api-reference"
          }
        ],
        "values": [
          "Included",
          "Standard"
        ]
      }'
      variant="secondary"
      columnCount="7"
      actionLabel="Compact example"
      actionHref="#mega-menu-demo"
      footer="Not sure where to start? Talk to us."
    />
  }
}
Component outputs

Receive every typed component output

Use declarative output handlers in .wrn files or register a direct output handler from JavaScript. The canonical API exposes payload and does not require event.detail.

@openFires after the component opens.
@closeFires after the component closes.
@selectFires when an item, option, card, or result is selected.
@categoryFires when the component emits the category event.
Declarative handlers.wrn
<MegaMenu
  @open='console.log(payload)'
  @close='console.log(payload)'
  @select='console.log(payload)'
  @category='console.log(payload)'
/>
Direct output handlers.js
import { registerOutputHandler } from "@wrnexus/csr/outputs"

const component = document.querySelector("[data-ui-component=\"MegaMenu\"], [data-component=\"MegaMenu\"]")

if (component) registerOutputHandler(component, "open", (payload) => {
  console.log("open", payload)
})

if (component) registerOutputHandler(component, "close", (payload) => {
  console.log("close", payload)
})

if (component) registerOutputHandler(component, "select", (payload) => {
  console.log("select", payload)
})

if (component) registerOutputHandler(component, "category", (payload) => {
  console.log("category", payload)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
colorstring"primary"No
sizestring"default"No
labelstring"Menu"No
iconstring""No
columnsunknown[][]No
railunknown[][]No
featuredRecord<string, unknown>{}No
variantstring"default"No
densitystring"default"No
panelWidthstring"xl"No
panelAlignstring"start"No
columnCountnumber0No
fullWidthbooleanfalseNo
openOnHoverbooleantrueNo
activeCategorystring""No
actionLabelstring""No
actionHrefstring""No
actionIconstring"icon-[lucide--arrow-right]"No
footerstring""No
defaultOpenbooleanfalseNo
classstring""No