Skip to main content

Overview

Right-click anywhere in this area
Delete
Context Menu opens on right-click (or long-press on mobile) over a target area, providing context-sensitive actions for that element. It shares the same item primitives as DropdownMenu.

Installation


Usage


Variants

With Checkbox and Radio Items

Table Row Context Menu


API Reference

ContextMenuContent

number
default:"0"
Offset from the cursor position on the alignment axis.
string
Additional class names for the menu panel.

ContextMenuItem

string
default:"default"
Visual style. "destructive" renders item text in red.
boolean
default:"false"
Disables the item.
() => void
Callback fired when item is selected. Menu closes automatically.

Accessibility

  • Context Menu opens at the cursor position with role="menu"
  • ContextMenuTrigger area does not show a visual indicator — consider adding a subtle hint for discoverability
  • Keyboard: Shift+F10 or the Menu key opens context menu at the focused element
  • All the same keyboard navigation as DropdownMenu applies (Arrow keys, Enter, Escape)

Do’s & Don’ts

Do

  • Use Context Menu for actions directly tied to the right-clicked element
  • Include keyboard shortcuts to mirror native OS conventions
  • Keep items to 5–8 max — only actions relevant to that specific element
  • Use on data-dense areas: table rows, file lists, canvas elements

Don't

  • Don’t rely solely on right-click — always provide primary action buttons too
  • Don’t use Context Menu as a main navigation mechanism
  • Don’t add items that aren’t contextually relevant to the trigger area
  • Don’t show a Context Menu on mobile without a fallback (long-press isn’t obvious)