Context Menu

The menu that appears on right-click or Control-click.

@cupertinoui/context-menuBase UI Context Menu Registry JSON
Right-click here

Installation

pnpm dlx shadcn@latest add @cupertinoui/context-menu

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import {
  ContextMenu,
  ContextMenuContent,
  ContextMenuItem,
  ContextMenuTrigger,
} from "@/components/ui/context-menu"

<ContextMenu>
  <ContextMenuTrigger>Right-click here</ContextMenuTrigger>
  <ContextMenuContent>
    <ContextMenuItem>Get Info</ContextMenuItem>
  </ContextMenuContent>
</ContextMenu>

API Reference

Every part forwards the props of the underlying Base UI Context Menu part. The props below are the ones CupertinoUI adds or changes.

ContextMenuItem

PropTypeDescription
variant"default" | "destructive"
Default: "default"
Destructive items are red.
insetbooleanIndent the item.