GodUI

Context Menu

A right-click menu that springs open from the exact cursor point and flips to stay inside the viewport, with icons, shortcuts, and destructive actions.

quarterly-report.pdf
Right-click for actions

Installation

pnpm dlx shadcn@latest add "https://godui.design/r/context-menu.json"

Usage

tsx
 
import { ContextMenu } from "@/components/godui/context-menu";
tsx
 
const items = [
  { label: "Copy", shortcut: "⌘C", onSelect: () => {} },
  { type: "separator" },
  { label: "Delete", destructive: true, onSelect: () => {} },
];

<ContextMenu items={items}>
  <YourTargetArea />
</ContextMenu>;

Props

PropTypeDefaultDescription
itemsContextMenuItem[]Items, separators, and labels
childrenReactNodeThe area that responds to right-click

On this page

Built with GodUI

Beautifully crafted motion components for modern interfaces.

Star on GitHub