ContextMenu
Right-click triggered contextual menu anchored to the target element.
Examples
Basic (cut/copy/paste)
Right-click the area to reveal a simple context menu.
With icons
Each menu item includes an icon prefix; Delete is styled as a destructive action.
With submenu
Hover over Share to reveal a nested submenu.
With Shortcuts
With Checkboxes
Destructive
Installation
pnpm add @rokle/components @rokle/tokensInstalls with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.
Usage
import { ContextMenu } from "@rokle/components";import { ContextMenu } from "@rokle/components";
export function Example() {
return <ContextMenu />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| items | MenuItem[] | - | Menu items with label and onClick. |
| children | ReactNode | - | Element that triggers the context menu on right-click. |