preskok/ui

Context Menu

Right-click context menu built on top of the menu primitives.

Installation

pnpm dlx @preskok-org/ui@latest add context-menu

Usage

import { ContextMenu } from "@/registry/preskok/ui/preskok-ui/context-menu"
 
export function ContextMenuDemo() {
  return (
    <ContextMenu>
      <ContextMenu.Trigger className="rounded border px-3 py-2">
        Right click me
      </ContextMenu.Trigger>
      <ContextMenu.Content>
        <ContextMenu.Item>Copy</ContextMenu.Item>
        <ContextMenu.Item>Paste</ContextMenu.Item>
        <ContextMenu.Separator />
        <ContextMenu.Item intent="danger">Delete</ContextMenu.Item>
      </ContextMenu.Content>
    </ContextMenu>
  )
}