Skip to content
Overlays

Context Menu

A menu that appears on right-click. Provides contextual actions relevant to the element under the cursor.

Right-Click Menu

Right-click here

Import

import {
  ContextMenu,
  ContextMenuContent,
  ContextMenuItem,
  ContextMenuTrigger,
} from "@mikenotthepope/substrateui"

Composition

ContextMenu
├── ContextMenuTrigger
└── ContextMenuContent
    └── ContextMenuItem

Direction

A submenu opens toward the end of the line, so in RTL it opens leftward and its trigger's ChevronRight should point that way too. The RTL icon audit classifies it flip in RTL; the indicator carries rtl:-scale-x-100 for that reason.

Positioning and padding are logical throughout, so the menu itself needs nothing configured — flip the site's direction and the alignment follows.

API Reference

PropTypeDefaultDescription
children
required
React.ReactNodeThe trigger area and menu content. Compose with ContextMenuTrigger and ContextMenuContent.