Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
react-contextmenu-yanxi
Advanced tools
ContextMenu in React with accessibility support. Live Examples can be found here
Using npm
npm install --save react-contextmenu
Using yarn
yarn add react-contextmenu
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);
}
function MyApp() {
return (
<div>
<ContextMenuTrigger id="some_unique_identifier">
<div className="well">Right click to see the menu</div>
</ContextMenuTrigger>
<ContextMenu id="some_unique_identifier">
<MenuItem data={"some_data"} onClick={this.handleClick}>
ContextMenu Item 1
</MenuItem>
<MenuItem data={"some_data"} onClick={this.handleClick}>
ContextMenu Item 2
</MenuItem>
<MenuItem divider />
<MenuItem data={"some_data"} onClick={this.handleClick}>
ContextMenu Item 3
</MenuItem>
</ContextMenu>
</div>
);
}
ReactDOM.render(<MyApp myProp={12}/>, document.getElementById("main"));
see usage docs / examples for more details.
For Changelog, see releases
MIT. Copyright(c) Vivek Kumar Bansal
FAQs
Context Menu implemented in React
We found that react-contextmenu-yanxi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.