An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          


Supports FontAwesome!

GitHub Download Count


# 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):
![Example Menu](https://by3301files.storage.live.com/y4meHtRWf5VBnb5SxLdxHbo-apkdGGw8MCFqGiW-T7sUl7KSlJkkWMDMwZeTXBDCFw7qZqbCUZ58hPljmvqTTxu7mm819PPWu_PpmtJLw-rXW50bzstHEQotokCZgFbU6Wy4lYt2824E7pbUON25EnoqboF1ASE8-c7OwIgUp_8P-HdzcGSOcxR_Lb7K-f5JY2K?width=252&height=84&cropmode=none)


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