---
title: "Context Menu"
description: "A menu that opens on right-click or long-press, with submenus, checkbox and radio items, and shortcuts. Built on Base UI."
plan: Free
docs: https://ui.edbn.me/docs/components/context-menu
---

# Context Menu

A menu that opens on right-click or long-press, with submenus, checkbox and radio items, and shortcuts. Built on Base UI.

## Installation

```bash
npx shadcn@4.19.0 add https://ui.edbn.me/r/context-menu.json
```

## Dependencies
- npm: @base-ui/react@^1.8.0, lucide-react@^1.33.0
- edbn: edbn-base

## Usage

```tsx examples/context-menu-basic.tsx
"use client";
import {
  ContextMenu,
  ContextMenuContent,
  ContextMenuItem,
  ContextMenuSeparator,
  ContextMenuTrigger,
} from "@/components/ui/context-menu";

export default function ContextMenuBasicPreview() {
  return (
    <ContextMenu>
      <ContextMenuTrigger className="grid h-36 w-64 place-items-center rounded-card bg-card text-muted-foreground">
        Right click here
      </ContextMenuTrigger>
      <ContextMenuContent>
        <ContextMenuItem>Back</ContextMenuItem>
        <ContextMenuItem>Reload</ContextMenuItem>
        <ContextMenuSeparator />
        <ContextMenuItem>Inspect</ContextMenuItem>
      </ContextMenuContent>
    </ContextMenu>
  );
}
```

## Files
- components/ui/context-menu.tsx (402 lines)

## For agents
- Base theme, once per project: npx shadcn@4.19.0 add https://ui.edbn.me/r/edbn-base.json
- MCP server with search, items, examples and source: https://ui.edbn.me/mcp
- Every page and item: https://ui.edbn.me/llms.txt
