Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 2.09 KB

README.md

File metadata and controls

34 lines (25 loc) · 2.09 KB

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

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