Skip to content
ν”„λ‘œμ νŠΈ

fkhadra/react-contexify has 1,225 GitHub stars and 132 forks. GitHot measured 0 stars in 24 hours, -1 in 7 days, and -1 in 15 days. Last checked 2026-11-21 23:35 UTC. Last push 2024-11-25.

이 수치λ₯Ό μΈ‘μ •ν•˜λŠ” 방법

What you can do

  • Easy to set up for real, you can make it work in less than 10sec!
  • Super easy to customize thanks to css variables πŸ’…
  • Custom position
  • Sub menu support

μΈ‘μ •λœ μŠ€νƒ€ 증가

in 24h
0
in 7 days
-1
in 15 days
-1
in 1 month
기둝 μˆ˜μ§‘ 쀑

μ„œλ‘œ κ²ΉμΉ˜λŠ” κΈ°κ°„μ˜ μˆœμ¦κ°€λŸ‰μ΄λ©° 일별 합계가 μ•„λ‹™λ‹ˆλ‹€. 츑정값이 μ—†μœΌλ©΄ λΉ„μ›Œ λ‘‘λ‹ˆλ‹€. μŠ€νƒ€λŠ” 관심도λ₯Ό λ‚˜νƒ€λ‚΄λ©° ν’ˆμ§ˆμ„ 보μž₯ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

μ†Œκ°œ

πŸ‘Œ Add a context menu to your react app with ease

μ›Ή 및 μ•±

README.md

Original
screenshot 2018-10-31 at 13 32 57

React-contexify CI npm npm license

contexify

Features

  • Easy to set up for real, you can make it work in less than 10sec!
  • Super easy to customize thanks to css variables πŸ’…
  • Custom position
  • Sub menu support
  • Does not go offscreen
  • Dark mode πŸŒ’
  • Keyboard navigation + keyboard shortcut!
  • Built-in animations
  • Easy to test!
  • Written in Typescript πŸ’ͺ
  • Tiny! (3k gzipped)

Check the documentation for more!

Documentation

Go here.

Installation

Using yarn

$ yarn add react-contexify

Using npm

$ npm install --save react-contexify

The gist

import { Menu, Item, Separator, Submenu, useContextMenu } from 'react-contexify';
import 'react-contexify/ReactContexify.css';

const MENU_ID = 'blahblah';

function App() {
  const { show } = useContextMenu({
    id: MENU_ID,
  });

  function handleContextMenu(event){
      show({
        event,
        props: {
            key: 'value'
        }
      })
  }

  // I'm using a single event handler for all items
  // but you don't have too :)
  const handleItemClick = ({ id, event, props }) => {
    switch (id) {
      case "copy":
        console.log(event, props)
        break;
      case "cut";
        console.log(event, props);
        break;
      //etc...
    }
  }

  return (
    <div>
    <p onContextMenu={handleContextMenu}>lorem ipsum blabladhasi blaghs blah</p>  
    <Menu id={MENU_ID}>
      <Item id="copy" onClick={handleItemClick}>Copy</Item>
      <Item id="cut" onClick={handleItemClick}>Cut</Item>
      <Separator />
      <Item disabled>Disabled</Item>
      <Separator />
      <Submenu label="Foobar">
        <Item id="reload" onClick={handleItemClick}>Reload</Item>
        <Item id="something" onClick={handleItemClick}>Do something else</Item>
      </Submenu>
    </Menu>
    </div>
  );
}

Contribute

Any idea and suggestions are welcome. Please have a look at the contributing guide.

License

React Contexify is licensed under MIT.

κ΄€λ ¨ ν”„λ‘œμ νŠΈ μ‚΄νŽ΄λ³΄κΈ°

λΆˆλŸ¬μ˜€λŠ” 쀑…