Skip to main content
Neural UIv2.0.0Documentation
View v1 GitHub

Menubar

Organize top-level actions horizontally with dropdown groups and keyboard navigation.

Category
Navigation
Import
@neural-ui/core/menu
Selector
neu-menubar
import { NeuMenubarComponent } from '@neural-ui/core/menu';

Usage

Pass a NeuMenuItem collection. Top-level leaves act directly; entries with children open MenuButton popups. visible:false hides entries and disabled prevents interaction. Item content can be replaced with neuMenuItem, including content in the child popup. Keep top-level labels short and give the bar a descriptive ariaLabel.

Examples

Try the interaction and open Code for the complete implementation.

Examples

Selected: โ€” ยท itemClick: 0 ยท Commands: 0

Try and configure

Change the options, try the result and see the template update. Open Code for the complete data model and implementation.

Try and configure

Selected: โ€” ยท itemClick: 0 ยท Commands: 0

Core options update this template. Item icons, badges and disabled actions belong to the data model shown in Code.

template.html
<neu-menubar
  [items]="items"
  ariaLabel="Example navigation"
  (itemClick)="selectItem($event)"
/>

Data and content

itemClick reports an activated leaf. Commands belong to the item data and execute when activated. The open dropdown is owned by the component; no open Input is exposed. Moving across groups while a dropdown is open transfers the active dropdown rather than requiring another click.

Accessibility and keyboard

Tab enters the bar, left/right traverse available top-level items and Home/End reach its ends. Down/up opens a group at its first/last item; inside it, use the Menu keyboard controls. Escape closes the popup and restores trigger focus. Direction follows the document.

Key
Action
Tab Enter or leave the bar.
ArrowLeft / ArrowRight Move between available top-level actions following text direction.
ArrowDown / ArrowUp Open a group at its first/last action; inside the group, move through actions.
Home / End Focus the first or last available action.
Enter Activate the focused action or open its group.
Space Activate the focused action or open its group.
Escape Close the popup and restore focus to its trigger.

API

Inputs and Outputs match the installed package. Named types link to definitions. Each available Template/projection has an executable example.

Inputs

Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.

Name
Type
Default
Template binding
Description
ariaLabelstring'Menu bar'[ariaLabel]Accessible navigation/menu name. Use a label specific to this region.
itemsNeuMenuItem[][][items]Action data with unique keys; children create groups. Core does not mutate this array.

Outputs

Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.

Name
Payload
Template binding
Description
itemClickNeuMenuItem(itemClick)="onItemClick($event)"Emits the activated leaf/action. The optional command runs first; disabled entries do not activate.

Templates

ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.

Name
Mechanism
Contract
NeuMenuItemDirectiveView example Public template directive (entrypoint)ng-template[neuMenuItem]

Each example demonstrates a different template. Switch between Demo and Code to inspect its implementation, imports and state.

Bar and popup item content

NeuMenuItemDirective

Bar and popup item content

Selected: โ€” ยท itemClick: 0 ยท Commands: 0

Public Types

Open a type to inspect its definition and interface fields.

Styles and tokens

Use supported public tokens for the component. Icon resolution and surrounding example layout belong to the application. Check both themes and narrow screens.

Specific tokens

This component uses shared theme tokens rather than dedicated component hooks.

Shared tokens used

Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.

Token
Purpose here
Other impact
Default / fallback
No data