1.1.6 • Published 7 years ago

react-ctx-menu v1.1.6

Weekly downloads
24
License
MIT
Repository
github
Last release
7 years ago

react-ctx-menu

A simple, effective, lightweight context menu with animation made for React.

menu

To use:

Install the component in your project:

npm install react-ctx-menu --save

Import the component into your project:

import CTXMenu from 'react-ctx-menu';

Pass a ctxId, and an array of menu items with icons, labels, and functions:

<CTXMenu
       ctxId={'settings-text'}
       menuItems={[
            {'image': logo, 'text': 'Label 1', 'onClick': this.sample},
            {'image': logo, 'text': 'Label 2', 'onClick': this.sample},
            {'image': logo, 'text': 'Label 3', 'onClick': this.sample},
            {'image': logo, 'text': 'Label 4', 'onClick': this.sample}
       ]}
/>

Where logo is an image file imported into the parent component:

import logo from './logo.svg';

The ctxId is the area in which you'd like right-click functionality. Add a unique id to your right-clickable element, and react-context-menu will be available anywhere within that element.

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.1.9

7 years ago