Skip to content

Commit 23b4768

Browse files
committed
📝 Update readme
1 parent cdb63bc commit 23b4768

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,35 @@
1-
# react-context-menu
1+
# 📝 react-context-menu
2+
3+
## Installation
4+
5+
```bash
6+
npm i --save @totase/react-context-menu
7+
```
8+
9+
## Usage
10+
11+
All components are exported from the main component, `ContextMenu`, so that's the only one needed to import.
12+
13+
```tsx
14+
import { ContextMenu } from '@totase/react-context-menu';
15+
16+
...
17+
18+
return (
19+
<>
20+
<div id="context-menu-trigger">I will trigger the menu when right clicked<div>
21+
22+
<ContextMenu triggerId="context-menu-trigger">
23+
<ContextMenu.Item onClick={() => console.log("what up")}>Item 1</ContextMenu.Item>
24+
<ContextMenu.Item disabled>Disabled item</ContextMenu.Item>
25+
<ContextMenu.Separator />
26+
<ContextMenu.Item onClick={() => console.log("what up")}>Item 3</ContextMenu.Item>
27+
</ContextMenu>
28+
</>
29+
)
30+
31+
```
32+
33+
## License
34+
35+
react-context-menu is licensed under MIT.

0 commit comments

Comments
 (0)