Context menu

Also called right-click menu or shortcut menu

A menu of actions for one item that opens at the pointer when you right-click it, or long-press it on a touch screen.

What is Context menu?

A context menu appears exactly where you right-click and lists actions for the thing under the pointer: open, rename, duplicate, or delete a file. Because the actions match what you clicked, it is a fast shortcut for people who already know where to look.

It belongs in apps people spend a lot of time in, like file browsers, editors, and design tools. Treat it as a shortcut and keep every action in it reachable from a visible button or menu as well, since many people never think to right-click and touch screens need a long press.

Open it instantly at the pointer, shift it so it stays on screen near the edges, highlight the item it belongs to, and close it on Escape or a click elsewhere. Calling preventDefault() in the contextmenu event replaces the browser's own menu, so do that only on elements that offer their own.

Often confused with

Dropdown menu
A dropdown menu opens from a visible button. A context menu is hidden until you right-click or long-press, and it opens at the pointer.
All terms

Dropdown menu

A list of actions that drops down from a button when you click it, then closes as soon as you pick one.

Command palette

A search box that opens with a shortcut like ⌘K and lets you find and run any command or page by typing a few letters.

Keyboard shortcut

A key combination that runs an action directly, like ⌘S to save or ⌘K to open search, so frequent users can skip the mouse.

Affordance

The visual cues that tell people what they can do with an element, like a raised button that looks pressable or a grip that says "drag me".