What is a context menu in UX design?
A context menu is a menu that appears in response to a secondary interaction on an element, typically right-click on desktop, long press on mobile, or the context menu key on keyboard. It displays a list of actions relevant to the element or selection that triggered it, without requiring the user to navigate to a toolbar or menu bar. Context menus are power user tools: they surface actions efficiently for users who have discovered them, but they are hidden affordances that many users, especially novice ones, never encounter.
When should you use context menus?
Context menus are appropriate as a secondary access point for actions that are already available through other primary paths, not as the sole access point for important functionality. Right-clicking a file to see copy, cut, paste, and delete options is effective because those actions are also available through menus and keyboard shortcuts; the context menu provides an additional efficient path for users who prefer it. Context menus are less appropriate when the actions they contain are not available elsewhere, because users who have not discovered the context menu interaction model will never find those actions.
How to design effective context menus?
Limit context menus to eight or fewer items to keep them scannable. Group related actions with dividers and place the most commonly used actions near the top. Use clear, specific action labels: "Delete file" not "Delete." Show keyboard shortcuts next to their actions for power users who want to learn them. Destructive actions like delete should be placed at the bottom of the menu and visually distinguished from safe actions. On mobile, ensure that the long-press interaction has sufficient duration to avoid triggering accidentally during scroll, and that the resulting menu has large enough touch targets to operate accurately.