Angular UI Components Documentation
The Angular NavBar is a responsive horizontal or vertical navigation bar. This guide adds the Angular NavBar (jqxNavBar) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxnavbar 
In an Angular project (to start one, see Getting started with Angular), add the package with the Angular CLI. It asks for a theme and adds the styles to angular.json:
ng add jqwidgets-ng
Components are standalone: add jqxNavBarModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxNavBarModule } from 'jqwidgets-ng/jqxnavbar';
@Component({
selector: 'app-root',
imports: [jqxNavBarModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Default Functionality demo.
<div style="width: 80%;">
NavBar with 2 Items. Each item is with 50% width.
<br />
<jqxNavBar id="navBar1" [height]="40" [selectedItem]="0">
<ul>
<li>1</li>
<li>2</li>
</ul>
</jqxNavBar>
<br />
NavBar with 3 Items. Each item is with 33.33% width.
<br />
<jqxNavBar id="navBar2" [height]="40" [selectedItem]="0">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
</jqxNavBar>
<br />
NavBar with 4 Items. Each item is with 25% width.
<br />
<jqxNavBar id="navBar3" [height]="40" [selectedItem]="0">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
</jqxNavBar>
<br />
NavBar with 5 Items. Each item is with 20% width.
<br />
<jqxNavBar id="navBar4" [height]="40" [selectedItem]="0">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
</jqxNavBar>
<br />
NavBar with more than 5 Items. Items are displayed in 2 columns and each item is with 50% width.
<br />
<jqxNavBar id="navBar5" [height]="160" [selectedItem]="0">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
</ul>
</jqxNavBar>
<br />
NavBar with "columns" set to ["30%", "50%", "20%"].
<br />
<jqxNavBar id="navBar6" [height]="40" [selectedItem]="0" [columns]="['30%', '50%', '20%']">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
</jqxNavBar>
</div>
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { jqxNavBarModule } from 'jqwidgets-ng/jqxnavbar';
@Component({
imports: [CommonModule, jqxNavBarModule],
selector: 'app-root',
templateUrl: './app.html'
})
export class App {}
Options are inputs, bound with [name]="value".
Events are outputs named on plus the event name with a capital first letter. For example, change: This event is triggered when the user selects an item.
<jqxNavBar (onChange)="onChange($event)"></jqxNavBar>
onChange(event: any): void {
console.log(event.args);
}
Get the component with a signal query and call its methods. For example, open: When NavBar is minimized, opens the popup.
<jqxNavBar #myNavBar></jqxNavBar>
import { Component, viewChild } from '@angular/core';
import { jqxNavBarModule, jqxNavBarComponent } from 'jqwidgets-ng/jqxnavbar';
@Component({
selector: 'app-root',
imports: [jqxNavBarModule],
templateUrl: './app.html'
})
export class App {
readonly myNavBar = viewChild.required<jqxNavBarComponent>('myNavBar');
run(): void {
this.myNavBar().open();
}
}