ContextMenu
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.
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.
Sizes
Use the size prop to change padding and font-size of menu items. Combine with different trigger heights for compact or spacious menus.
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
Related Components
View allCommand palette (⌘K) with fuzzy search, grouped commands, keyboard shortcuts, and recent history
Modal dialog with focus trap, backdrop click handling, scroll locking, and nested dialog support
Side panel with directional sliding, scroll locking, and responsive mobile-first design
Dropdown menu with collision detection, sub-menus, dividers, and keyboard navigation