
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@ctrl/ngx-rightclick
Advanced tools
Context Menu Service for Angular
Demo: https://ngx-rightclick.vercel.app
if you don't already have @angular/cdk that needs to be installed too
npm install @ctrl/ngx-rightclick
Latest version available for each version of Angular
| ngx-rightclick | Angular |
|---|---|
| 3.0.1 | 9.x |
| current | >= 10.x |
Import and Add to NgModule
import { ContextMenuModule } from '@ctrl/ngx-rightclick';
Add context menu directive to element and pass the menu component to be shown. Important the menu component must also be added as to entryComponents in your NgModule. See here
// show.component.ts
@Component({
template: `
<div [contextMenuTrigger]="menu" (menuAction)="handleMenuAction($event)">Right Click</div>
`,
})
export class ShowComponent {
// menu component imported and assigned locally
menu = SimpleMenuComponent;
}
// my-menu.component.ts
import { Component } from '@angular/core';
import { MenuComponent, ContextMenuService, MenuPackage } from '@ctrl/ngx-rightclick';
@Component({
selector: 'simple-menu',
// add your menu html
template: `<a (click)="handleClick()">Download</a>`,
})
export class SimpleMenuComponent extends MenuComponent {
// this module does not have animations, set lazy false
lazy = false;
constructor(public menuPackage: MenuPackage, public contextMenuService: ContextMenuService) {
super(menuPackage, contextMenuService);
// grab any required menu context passed via menuContext input
console.log(menuPackage.context);
}
handleClick() {
// IMPORTANT! tell the menu to close, anything passed in here is given to (menuAction)
this.contextMenuService.closeAll();
}
}
Last step add css somewhere in your global styles
.cdk-overlay-container {
position: fixed;
z-index: 1000;
pointer-events: none;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ngx-contextmenu.cdk-overlay-pane {
position: absolute;
pointer-events: auto;
box-sizing: border-box;
}
// not required but can help with mobile right click
.target {
user-select: none;
}
| name | type | description |
|---|---|---|
| contextMenuTrigger / contextSubmenuTrigger | component | the menu or submenu to be shown |
| menuContext | any | passed to the menu component via MenuPackage |
| holdToDisplay | number | default: 1000 ms pressing down on mobile to show menu |
| name | type | description |
|---|---|---|
| menuAction | any | whatever is passed to ContextMenuService.closeAll |
| menuClose | void | triggered whenever a menu or submenu is closed |
Use the contextSubmenuTrigger directive as you would the contextMenuTrigger inside your menu.
ngx-contextmenu
Find the Angular Component of your dreams on angular.parts
MIT
FAQs
GitHub Buttons for Angular. Star, Like, Follow and more
The npm package @ctrl/ngx-rightclick receives a total of 420 weekly downloads. As such, @ctrl/ngx-rightclick popularity was classified as not popular.
We found that @ctrl/ngx-rightclick demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.