ContextMenu

Overlay

Right-click context menu with nested menus, checkboxes, radio items, and keyboard shortcuts display

ContextMenu

Display contextual actions on right–click or long–press. Supports checkboxes, radio groups, shortcuts, submenus and design system variants out of the box.

Basic usage

Wrap interactive content with ContextMenuTrigger and render menu items inside ContextMenuContent. Combine items, checkboxes, radio groups and shortcuts for richer menus.

Right click anywhere in this area

This menu demonstrates items, checkboxes, radio groups, submenus and keyboard shortcuts.

Bookmarks bar:visible
Full URLs:off
Shared with:Pedro

Variants

Use the variant prop to match different surfaces and semantic states. ContextMenu and ContextMenuItem share the same variant system as other Saha UI components.

Default

Neutral surface

Primary

Emphasized surface

Success

Positive actions

Warning

Attention needed

Error

Destructive actions

Outline / ghost

Subtle surfaces

Sizes

Use the size prop to change padding and font-size of menu items. Combine with different trigger heights for compact or spacious menus.

Small

Compact menus

Medium

Default size

Large

Spacious layouts

Usage Guidelines

When to Use

  • Right-click actions
  • Table row actions
  • File actions

Accessibility

  • Keyboard trigger support
  • Menu navigation with arrows

Performance

  • Portal rendering
  • Event delegation

Common Mistakes

  • Critical actions only in context menu
  • Nested menus too deep

Frequently Asked Questions

ContextMenu is a right-click menu with nested items, checkboxes, and shortcut display.
Yes, ContextMenu supports nested submenus.

View on GitHub

See the full source code on GitHub