Simple Context menu component for react showing all inherited parents menu with SSR compatibility.
npm install react-inheritable-contextmenu
Simple Context menu component for react showing all inherited parents menu with SSR compatibility.
Check the sample here ( sources )
```
npm i react-inheritable-contextmenu -s
Because none of the existing ones have met my requirements :
- Ability to inherit & include parents context menus
- Possibility to render menu items basing the browser event
- Render menus just in time
- Simple to use
- Simple to animate with css
- Do not break SSR
Version ^2.0.0 only work with React ^18
Use V1.x.x for previous React versions
`jsx
import { ContextMenu } from "react-inheritable-contextmenu";
// override default rendered comps
// * there is no css builtin, but there is classNames .inContextMenuLayer > .inContextMenu .inContextSubMenu
ContextMenu.DefaultMenuComp = Paper
//ContextMenu.DefaultMenuComp = ( { children } ) =>
//
// add optional cool anims ( choose & add in css any anims in http://animista.net/ )
ContextMenu.DefaultShowAnim = 'slide-in-blurred-left';
ContextMenu.DefaultHideAnim = 'slide-out-blurred-right';
// set show/hide anims duration (default to 250)
ContextMenu.DefaultAnimDuration = 200;
// Some trigering options ( defaults )
// ContextMenu.DefaultMenuEvent = "contextmenu";
// ContextMenu.shouldUseContextMenu = e => (e.button === 2 && e.buttons !== 4); // Default: don't trigger if right click + middle click
render(){
return
//...
``
BTC : bc1qh43j8jh6dr8v3f675jwqq3nqymtsj8pyq0kh5a
Paypal :
MIT license