Gathering detailed insights and metrics for ember-context-menu
Gathering detailed insights and metrics for ember-context-menu
Gathering detailed insights and metrics for ember-context-menu
Gathering detailed insights and metrics for ember-context-menu
ember-bootstrap-context-menu
Context menu for ember-bootstrap
ember-simple-context-menu
The simple ember addon for context menu
ember-right-click-menu
An easy and flexible addon to add context menus anywhere in your application
em-context-menu
The context menu component addon for ember.
npm install ember-context-menu
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (86.11%)
SCSS (5.16%)
HTML (4.98%)
Handlebars (3.76%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
23 Stars
61 Commits
16 Forks
1 Watchers
30 Branches
8 Contributors
Updated on Jun 19, 2023
Latest Version
0.5.2
Package Id
ember-context-menu@0.5.2
Unpacked Size
111.87 kB
Size
67.95 kB
File Count
20
NPM Version
6.13.1
Node Version
13.3.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
7
26
An ember-cli addon to add any right-click-menu to your components. Try it here
In your application's directory:
1$ ember install ember-context-menu
In your application.hbs add the following:
1{{context-menu}}
WARNING: You need to add this to make the context-menu work, and should add it just once in your application.
This mixin is designed to add a context-menu to any component. Add it to your component like this:
1import Component from '@ember/component'; 2import contextMenuMixin from 'ember-context-menu'; 3 4export default Component.extend(contextMenuMixin, { 5 // your component properties 6 7 _contextMenu(e) { 8 // do anything before triggering the context-menu 9 } 10}); 11
Your component needs at least an array of contextItems, which should have a label and an action.
1import Component from '@ember/component'; 2 3export default Component.extend(contextMenuMixin, { 4 contextItems: [ 5 { 6 label: 'do something', 7 action(selection, details, event) { /* do something */ } 8 } 9 ] 10});
:no_entry_sign: (Temporary removed from 0.2.0, back in 0.3.2)
You can optionally set an icon to show in front of the label. Just give the name of the icon.
1 contextItems: [ 2 { 3 label: 'do something', 4 icon: 'search', 5 action() { /* do something */ } 6 } 7 ]
The icons that you can use are the one from font-awesome. See http://fontawesome.io/icons/ for the icons to use. Special thanks to the ember-font-awesome addon.
You can add as many sub-actions as you like, but keep in mind it could blow out of your screen ;-)
1 contextItems: [ 2 { 3 label: 'multiple actions', 4 subActions: [ 5 { 6 label: 'sub action 1', 7 action() { /* do something */ } 8 } 9 ] 10 } 11 ]
This context-menu can even be used in case you have to pass an item to your action. You should add it as the contextSelection. This could be one or multiple items.
1 contextItems: [ 2 { 3 label: 'do something', 4 action(selection) { /* do something with the selection */ } 5 } 6 ], 7 8 contextSelection: { foo: 'bar' }
When it's an array of multiple items, the context-menu will show the amount of items you pass to the action.
If you want to pass some more details to your action, you can set is as the contextDetails. It will be passed to the action as the second argument.
1 contextItems: [ 2 { 3 label: 'do something', 4 action(selection, details) { /* do something */ } 5 } 6 ], 7 8 contextDetails: { foo: 'bar' }
When your item has no action and no sub-actions, it will be disabled by default. Also you could disable it by yourself to add the disabled property. This could be either a boolean or a function which gets the selection.
1 contextItems: [ 2 { 3 label: 'foo', 4 disabled: true 5 action() { /* do nothing */ } 6 }, 7 { 8 label: 'bar', 9 disabled(selection) { 10 /* return disabled depending on selection */ 11 }, 12 action() { /* do something */ } 13 } 14 ]
The addon has some predefined styling to just get a quick start. You are able to change the styling of the complete menu by overwriting the styling for the following classes:
context-menu
context-menu--sub
context-menu__item
context-menu__item--disabled
context-menu__item--parent
context-menu__item__label
(Set up by the BEM convention)
Test helpers are provided to make it easier to trigger the context menu to open.
1import { triggerContextMenu } from 'ember-context-menu/test-support'; 2 3triggerContextMenu('.my-class-selector');
Special thanks to @Fabriquartz (Fabriquartz.com)
See the Contributing guide for details.
This project is licensed under the MIT License.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/28 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
91 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More