Morpha UI

Context Menu

A menu opened with right-click or long-press.

Overview

The right-click / long-press counterpart of DropdownMenu — pixel-identical rows, surface and motion, opened at the pointer position. Items support the same anatomy: leading/trailing icons, supporting text, checkbox and radio rows, nested submenus and a destructive tone.

Right-click here
$ npx morpha-ui add context-menu

Examples

Selection rows

Right-click here

Installation

Morpha UI components are distributed via the Morpha CLI: npx morpha-ui add context-menu. In the meantime, since this is the base shadcn component, you can also add it directly:

npx shadcn@latest add context-menu

API Reference

Prop

Type

Accessibility

  • Keyboard users open it with Shift+F10 (or the context-menu key) on the trigger area.
  • Roving focus, typeahead and aria-checked on selection rows are handled by the Base UI primitive.
  • Context menus are shortcuts by convention — keep every action reachable through visible UI as well.

On this page