https://github.com/jacoobia/contextify
A lightweight vanilla JavaScript context menu library with FontAwesome support.
https://github.com/jacoobia/contextify
context-menu css fontawesome javascript javascript-library library ui
Last synced: 9 months ago
JSON representation
A lightweight vanilla JavaScript context menu library with FontAwesome support.
- Host: GitHub
- URL: https://github.com/jacoobia/contextify
- Owner: jacoobia
- License: mit
- Created: 2021-04-16T18:55:51.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T23:59:17.000Z (about 2 years ago)
- Last Synced: 2025-06-14T21:02:39.864Z (about 1 year ago)
- Topics: context-menu, css, fontawesome, javascript, javascript-library, library, ui
- Language: JavaScript
- Homepage:
- Size: 54.7 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Contextify
A lightweight vanilla JavaScript context menu library with FontAwesome support.
This library was written for use in a personal project of mine as an AIO solution for the features of a context menu that I wanted that I could only find spread across multiple different context menu libraries. This is very early doors and I will continue to maintain this however slowly that may be as I build my personal projects and use cases change or the need for features arise.
# Usage
```
//Construct our menu buttons
const menuButtons = [
{ icon: 'fa-camera', type: 'button', text: 'Screenshot', click: screenshot },
{ icon: 'fa-times-circle', type: 'button', text: 'Cancel', click: (event) => { menu.hide(false); }}
];
//Create our new Contextify object with the buttons, theme, container
const menu = new Contextify(menuButtons, "dark", document.body);
```
Which creates the following menu (note, the example requires you to have a form of FontAwesome installed):

Disclaimer: This has only been tested on desktop, MacOS and Windows 10. I have not tested this on any mobile devices.