# KptMenubar (kpt-menubar) A horizontal menu bar with drop-down submenus. Entries without `items` act as actions. Submenus sit on CDK Overlay (attached to `body`, never clipped by `overflow: hidden`). Requires `import '@angular/cdk/overlay-prebuilt.css';` Import: `import { KptMenubar } from '@konce-pt/angular';` ## Inputs / outputs - `items`: KptMenuItem[] - the top-level entries; submenus live in each entry's `items?` - `ariaLabel`: string - the bar's name for screen readers, e.g. "Editor menu" - `selected`: KptMenuItem ## Example items: KptMenuItem[] = [ { label: 'File', items: [{ label: 'New' }, { separator: true }, { label: 'Close', danger: true }] }, { label: 'Help' }, ]; ## 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 bar `--kpt-color-surface-raised`; the dropdown `--kpt-elevation-3`. ## Keyboard The bar follows the WAI-ARIA menubar pattern and is a single `Tab` stop (roving `tabindex`). - On a top item: `ArrowLeft`/`ArrowRight` move along the bar (wrapping, skipping disabled items), `Home`/`End` jump to the ends; `ArrowDown`, `Enter` or `Space` open the submenu with focus on its first entry, `ArrowUp` on its last one. - In a submenu: `ArrowDown`/`ArrowUp`/`Home`/`End` move between entries, `ArrowLeft`/`ArrowRight` open the neighbouring submenu, `Escape` and `Tab` close it and return focus to the top item. - While a submenu is open, moving along the bar opens the neighbour's submenu as well. ## ARIA The bar is `role="menubar"` with `aria-orientation="horizontal"`, named by `ariaLabel`. Top items with a submenu carry `aria-haspopup="menu"`, `aria-expanded` and (while open) `aria-controls`; each submenu is `role="menu"` named after its top item. The bar is a plain `
`, not `