# KptMegamenu (kpt-megamenu) A mega menu - a horizontal bar with a wide, multi-column panel. Structure: a top-level entry -> `items` (the columns) -> each column's `items` (the links). The panel sits on CDK Overlay (attached to `body`, never clipped by `overflow: hidden`). Requires `import '@angular/cdk/overlay-prebuilt.css';` Import: `import { KptMegamenu } from '@konce-pt/angular';` ## Inputs / outputs - `items`: KptMenuItem[] (3 levels: top -> columns -> links) - `ariaLabel`: string - the bar's name for screen readers, e.g. "Main menu" - `selected`: KptMenuItem (the clicked link, or a top item without columns) ## Example items = [{ label: 'Products', items: [ { label: 'Components', items: [{ label: 'Forms' }, { label: 'Tables' }] }, { label: 'Templates', items: [{ label: 'Dashboard' }] }, ], }]; ## Links (`url`) An entry with `url` and no children (and not disabled) renders as a real `` with the same look, so the browser handles navigation - opening in a new tab, the status-bar preview. `selected` still fires before the browser follows the link. ## Tokens The panel `--kpt-color-surface-raised`, `--kpt-elevation-3`. ## Keyboard The same as `kpt-menubar`: the bar is a single `Tab` stop (roving `tabindex`), `ArrowLeft`/`ArrowRight` and `Home`/`End` move along it, `ArrowDown` (or `Enter`/`Space`) opens the panel with focus on the first link, `ArrowUp` on the last one. In the panel `ArrowDown`/`ArrowUp`/`Home`/`End` walk through all links column by column, `ArrowLeft`/`ArrowRight` show the neighbouring item's panel, and `Escape` or `Tab` close it and return focus to the top item. ## ARIA The bar is `role="menubar"` (`aria-orientation="horizontal"`, named by `ariaLabel`); top items with columns carry `aria-haspopup="menu"`, `aria-expanded` and `aria-controls`. The panel is `role="menu"` named after the open item, each column is `role="group"` named by its title (`aria-labelledby`), and links are `role="menuitem"`. A top item without columns acts as an action: it emits `selected` instead of opening an empty panel, and has no caret. ## Router Links are plain ``, so without a router a click reloads the page. `navigate` fires on a plain click (left button, no Ctrl/Cmd/Shift, no `target="_blank"`) with `{ item, url, event }`: call `event.preventDefault()` and navigate with your router. Modified clicks stay native (a new tab, a new window). The library depends on no router. ## When to use it The `menubar`/`menu` roles switch a screen reader into application mode: page navigation by headings and links stops, and arrow keys are expected. That fits an application menu (File, Edit, View) or a large product menu. For plain site navigation (a few links in a header) the WAI-ARIA APG recommends the disclosure pattern instead - a `