Context Menu

A menu that appears on right-click. Provides contextual actions relevant to the element under the cursor.

Right-Click Menu

Right-click here
<ContextMenu>
  <ContextMenuTrigger className="flex h-32 w-full items-center justify-center rounded-md border-2 border-dashed text-sm text-muted-foreground">
    Right-click here
  </ContextMenuTrigger>
  <ContextMenuContent>
    <ContextMenuItem>Cut</ContextMenuItem>
    <ContextMenuItem>Copy</ContextMenuItem>
    <ContextMenuItem>Paste</ContextMenuItem>
    <ContextMenuItem>Delete</ContextMenuItem>
  </ContextMenuContent>
</ContextMenu>

API Reference

PropTypeDefaultDescription
children
required
React.ReactNodeThe trigger area and menu content. Compose with ContextMenuTrigger and ContextMenuContent.