Home / Components / Nav Each NeuNavItem has id, label and an icon key. route uses Angular routing and href is an external destination. children creates expandable groups, active marks the current entry and badge/badgeTone communicate status. Icons resolve through the application provider; an empty key omits the graphic.
Try the interaction and open Code for the complete implementation.
Demo Source
collapsedChange: expanded
Change the options, try the result and see the template update. Open Code for the complete data model and implementation.
Demo Source
collapsedChange: expanded
Core options update this template. Item icons, badges and disabled destinations belong to the data model shown in Code.
Behavior and content Structured data, callbacks and templates are shown in the examples and API.
Code adds advanced options when they differ from the default. Current configuration data and values appear in the template state.
<neu-nav
[items]="items"
ariaLabel="Example navigation"
[collapsed]="collapsed()"
[collapsible]="true"
expandLabel="Expand navigation"
collapseLabel="Collapse navigation"
(collapsedChange)="collapsed.set($event)"
>
<span neu-nav-brand class="menus-brand">
<app-navigation-example-icon kind="home" size="24" />
<span>Neural Studio</span>
</span>
<app-navigation-example-icon neu-nav-brand-icon kind="home" size="24" />
</neu-nav>These values match the current preview. Complete handlers, Core imports and templates are in Source.
import { signal } from '@angular/core';
export const items = [
{
"id": "workspace",
"label": "Workspace",
"icon": "home",
"route": "/en/components/nav",
"active": true
},
{
"id": "components",
"label": "Components",
"icon": "folder",
"children": [
{
"id": "button",
"label": "Button",
"icon": "file",
"route": "/en/components/button"
},
{
"id": "table",
"label": "Table",
"icon": "file",
"route": "/en/components/table",
"badge": "3",
"badgeTone": "info"
},
{
"id": "forms",
"label": "Form controls",
"icon": "folder",
"children": [
{
"id": "date-input",
"label": "DateInput",
"icon": "file",
"route": "/en/components/date-input"
}
]
}
]
},
{
"id": "settings",
"label": "Settings",
"icon": "settings",
"route": "/en/getting-started/project-configuration",
"disabled": true
}
];
export const collapsed = signal(false);Provide collapsed and accept collapsedChange for controlled rail width; omit collapsed for internal state. collapsible controls whether the toggle is present, not the applied state. Core owns local group disclosure and collapsed-mode flyouts. The application owns route/active data. Project brand icon, brand text and footer with their dedicated attributes. Nav has no itemClick Output.
Translate expandLabel/collapseLabel and name the navigation. Use native links/buttons with Tab and Enter/Space. Groups expose aria-expanded and active destinations expose aria-current. Collapsed flyouts retain labelled controls and Escape focus restoration. Keep brand/footer controls meaningful in both expanded and collapsed layouts.
Tab Move through enabled navigation links and group buttons. Enter Follow the focused link or activate the focused group button. Space Activate the focused group button; links keep their native behaviour. Escape Close an open collapsed flyout and restore focus.
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.
ariaLabelstring'Main navigation'[ariaLabel]Accessible navigation/menu name. Use a label specific to this region. collapsedboolean | undefinedundefined[collapsed]Applied collapsed state; undefined lets the component manage the state. collapseLabelstring'Collapse navigation'[collapseLabel]Accessible label of the toggle in expanded mode. collapsiblebooleantrue[collapsible]Shows/hides the collapse toggle without overriding collapsed. expandLabelstring'Expand navigation'[expandLabel]Accessible label of the toggle in collapsed mode. itemsNeuNavItem [][][items]Navigation data with id, label, icon and optional route/href, groups, active state and badges.
Outputs Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.
collapsedChangeboolean(collapsedChange)="onCollapsedChange($event)"Proposes the next collapsed state; update collapsed when controlled.
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.
[neu-nav-brand-icon]View example Content projection <ng-content select="[neu-nav-brand-icon]" />[neu-nav-brand]View example Content projection <ng-content select="[neu-nav-brand]" />[neu-nav-footer]View example Content projection <ng-content select="[neu-nav-footer]" />
Each example demonstrates a different template. Switch between Demo and Code to inspect its implementation, imports and state.
Brand icon [neu-nav-brand-icon]
Demo Source
collapsedChange: collapsed
Brand text [neu-nav-brand]
Demo Source
collapsedChange: expanded
Public Types Open a type to inspect its definition and interface fields.
import type { NeuIconKey } from '@neural-ui/core/foundation';
// Public declaration (reference only)
export type NeuIconKey = string;import type { NeuIconKey } from '@neural-ui/core/foundation';
import type { NeuNavItem } from '@neural-ui/core/nav';
// Public declaration (reference only)
export interface NeuNavItem {
active?: boolean;
badge?: string;
badgeTone?: 'neutral' | 'success' | 'warning' | 'danger' | 'info';
children?: NeuNavItem[];
disabled?: boolean;
href?: string;
icon: NeuIconKey;
id: string;
label: string;
route?: string;
}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 --neu-nav-toggle-bg Inherited theme value used by this component Field surface var(--neu-surface)Root declaration --neu-surface--neu-nav-toggle-bg-hover Inherited theme value used by this component Field surface var(--neu-surface-2)Root declaration --neu-surface-2--neu-nav-toggle-border Inherited theme value used by this component Field surface var(--neu-border)Root declaration --neu-border--neu-nav-toggle-color Inherited theme value used by this component Field surface var(--neu-text-muted)Root declaration --neu-text-muted--neu-nav-toggle-offset-top Inherited theme value used by this component Field surface 18pxRoot declaration No token alias--neu-nav-toggle-shadow Surface or overlay elevation Field surface 0 6px 14px color-mix(in srgb, var(--neu-text) 10%, transparent), inset 0 1px 0 color-mix(in srgb, var(--neu-surface) 82%, white)Root declaration --neu-text, --neu-surface--neu-nav-toggle-size Inherited theme value used by this component Field surface 28pxRoot declaration No token alias
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.
--neu-border Normal control and cell borders Shared by other Core consumers; scope the override. rgba(15, 23, 42, 0.08)--neu-error-bg Background of invalid or danger states Shared by other Core consumers; scope the override. #fee2e2--neu-error-text Error text and danger outline/ghost Button text in both themes Shared by other Core consumers; scope the override. #991b1b--neu-focus-ring-strong Emphasized focus treatment Shared by other Core consumers; scope the override. 0 0 0 var(--neu-focus-ring-width) rgba(0, 122, 255, 0.35)--neu-primary Brand color for active controls and emphasis Shared by other Core consumers; scope the override. #007aff--neu-primary-50 Subtle brand surface for hover and focus states Shared by other Core consumers; scope the override. #eff6ff--neu-primary-dark Dark brand shade; outline and ghost Button text in the light theme Shared by other Core consumers; scope the override. #005fcc--neu-surface Main field, header or control surface Shared by other Core consumers; scope the override. #ffffff
Show all shared tokens (26)
PreviousMenu Next ScrollTop