• This repository has been archived on 01/Sep/2020
  • Stars
    star
    1,403
  • Rank 33,517 (Top 0.7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Project is no longer maintained

Project is no longer maintained

NPM version Build Status Dependency Status Dev Dependency Status Code Climate

NPM

React Contextmenu

ContextMenu in React with accessibility support. Live Examples can be found here

Table of contents

Installation

Using npm

npm install --save react-contextmenu

Using yarn

yarn add react-contextmenu

Browser Support

  • IE 11 and Edge >= 12
  • FireFox >= 38
  • Chrome >= 47
  • Opera >= 34
  • Safari >= 8

Usage

Simple example

import React from "react";
import ReactDOM from "react-dom";
import { ContextMenu, MenuItem, ContextMenuTrigger } from "react-contextmenu";

function handleClick(e, data) {
  console.log(data.foo);
}

function MyApp() {
  return (
    <div>
      {/* NOTICE: id must be unique between EVERY <ContextMenuTrigger> and <ContextMenu> pair */}
      {/* NOTICE: inside the pair, <ContextMenuTrigger> and <ContextMenu> must have the same id */}

      <ContextMenuTrigger id="same_unique_identifier">
        <div className="well">Right click to see the menu</div>
      </ContextMenuTrigger>

      <ContextMenu id="same_unique_identifier">
        <MenuItem data={{foo: 'bar'}} onClick={this.handleClick}>
          ContextMenu Item 1
        </MenuItem>
        <MenuItem data={{foo: 'bar'}} onClick={this.handleClick}>
          ContextMenu Item 2
        </MenuItem>
        <MenuItem divider />
        <MenuItem data={{foo: 'bar'}} onClick={this.handleClick}>
          ContextMenu Item 3
        </MenuItem>
      </ContextMenu>

    </div>
  );
}

ReactDOM.render(<MyApp myProp={12}/>, document.getElementById("main"));

see usage docs / examples for more details.

API

API docs

FAQs

ALL FAQs

Who's using react-contextmenu?

Contributors

All Contributors

Changelog

For Changelog, see releases

License

MIT. Copyright(c) Vivek Kumar Bansal

More Repositories

1

eslint-plugin-jsx-control-statements

ESLint plugin for JSX-Control-Statements (https://github.com/AlexGilleran/jsx-control-statements)
JavaScript
51
star
2

react-notie

Simple notifications for react
JavaScript
27
star
3

illuminate-js

Syntax Highlighter made for and in ES6. Works both on Node and Browser (React too!).
TypeScript
26
star
4

react-dnd-es5-examples

react-dnd-es5-examples
JavaScript
25
star
5

FrontMatter

Frontmatter allows page-specific variables to be included at the top of a template using the YAML, JSON or INI format.
PHP
9
star
6

react-date-primitives

Primitives for creating Date-Picker and DateRange-Picker components in React. And It has zero dependencies!
TypeScript
8
star
7

css-tagged-template-to-object

babel-plugin-transform-css-tagged-template-to-object
JavaScript
7
star
8

formula1-app

F1 statistics and data-viz
Astro
6
star
9

easing-funcs

A collection of easing functions for JavaScript.
JavaScript
6
star
10

sqlite-wasm-demo

JavaScript
4
star
11

spectrum

Abandoned!
PHP
4
star
12

gulp-group-files

A gulp plugin for grouping files via an object for further processing
JavaScript
4
star
13

todomvc

My Playground for learning and experimenting with new stuff
CSS
3
star
14

gulp-edit-xml

Gulp plugin for editing xml files
JavaScript
2
star
15

react-sunburst

Sunburst chart made with react
HTML
2
star
16

openapi-to-ts

TypeScript
1
star
17

pnpm-setup-action

Composite Action for Github Workflows
1
star
18

webpack-lazy-load-chunks

webpack-lazy-load-chunks
JavaScript
1
star
19

eslint-config-vkbansal

Shareable ESLint Config
JavaScript
1
star
20

vkbansal.me

My Website/Blog
Astro
1
star
21

tsx-control-statements

TypeScript
1
star