Angular UI Components Documentation
The Angular Menu enables you to add menus to your website or web application. This guide adds the Angular Menu (jqxMenu) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxmenu 
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 jqxMenuModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxMenuModule } from 'jqwidgets-ng/jqxmenu';
@Component({
selector: 'app-root',
imports: [jqxMenuModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Open Direction demo.
<div style="margin-top: 100px; width: 310px;">
<jqxMenu #myMenu
[width]="310" [height]="30" [mode]="'horizontal'" [showTopLevelArrows]="true">
<ul>
<li style="width: 80px;">
<a href="#">About Us</a>
<ul>
<li><a href="#">History</a></li>
<li><a href="#">Our Vision</a></li>
<li>
<a href="#">The Team</a>
<ul>
<li><a href="#">Brigita</a></li>
<li><a href="#">John</a></li>
<li><a href="#">Michael</a></li>
<li><a href="#">Peter</a></li>
<li><a href="#">Sarah</a></li>
</ul>
</li>
<li><a href="#">Clients</a></li>
<li><a href="#">Testimonials</a></li>
<li><a href="#">Press</a></li>
<li><a href="#">FAQs</a></li>
</ul>
</li>
<li id='Services'>
<a href="#">Services</a>
<ul>
<li><a href="#">Delivery</a></li>
<li><a href="#">Shop Online</a></li>
<li><a href="#">Support</a></li>
</ul>
</li>
<li id='ContactUs'>
<a href="#">Contact Us</a>
<ul>
<li><a href="#">Enquiry Form</a></li>
<li><a href="#">Map & Driving Directions</a></li>
<li><a href="#">Your Feedback</a></li>
</ul>
</li>
</ul>
</jqxMenu>
</div>
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxMenuComponent } from 'jqwidgets-ng/jqxmenu';
import { CommonModule } from '@angular/common';
import { jqxMenuModule } from 'jqwidgets-ng/jqxmenu';
@Component({
imports: [CommonModule, jqxMenuModule],
selector: 'app-root',
templateUrl: './app.html'
})
export class App implements AfterViewInit {
readonly myMenu = viewChild.required<jqxMenuComponent>('myMenu');
ngAfterViewInit(): void {
this.myMenu().setItemOpenDirection('Services', 'left', 'up');
this.myMenu().setItemOpenDirection('ContactUs', 'left', 'down');
}
}
Options are inputs, bound with [name]="value".
Events are outputs named on plus the event name with a capital first letter. For example, itemclick: This event is triggered when a menu item is clicked.
<jqxMenu (onItemclick)="onItemclick($event)"></jqxMenu>
onItemclick(event: any): void {
console.log(event.args);
}
Get the component with a signal query and call its methods. For example, open: Opens the menu(only in context menu mode).
<jqxMenu #myMenu></jqxMenu>
import { Component, viewChild } from '@angular/core';
import { jqxMenuModule, jqxMenuComponent } from 'jqwidgets-ng/jqxmenu';
@Component({
selector: 'app-root',
imports: [jqxMenuModule],
templateUrl: './app.html'
})
export class App {
readonly myMenu = viewChild.required<jqxMenuComponent>('myMenu');
run(): void {
this.myMenu().open(0, 0);
}
}