JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16
  • Score
    100M100P100Q54012F
  • License MIT

A context menu implementation for React

Package Exports

  • react-jsx-context-menu
  • react-jsx-context-menu/dist/react-context-menu.min.js
  • react-jsx-context-menu/lib/ContextMenu.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-jsx-context-menu) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

NPM

react-jsx-context-menu

Installation

Using npm:

npm install --save react-jsx-context-menu

Using yarn:

yarn add react-jsx-context-menu

Usage

Here is a simple example of how to use:

import React from 'react';
import { render } from 'react-dom';
import ContextMenu from 'react-jsx-context-menu';

function App() {
  return (
    <div>
      <ContextMenu
        menu={
          <div
            style={{
              display: 'flex',
              flexDirection: 'column',
            }}
          >
            <button>Button 1</button>
            <button>Button 2</button>
          </div>
        }
      >
        <div>
          Right click me to see the context menu
        </div>
      </ContextMenu>
    </div>
  );
}
render(<App />, document.getElementById('root'));

You can play around with it here: https://codesandbox.io/s/5mxow9wkon

License

MIT