The context menu opens on right-click at the cursor. The dropdown opens on click from a trigger. Both use option rows inside a Column — share one menu-content pattern across the app.
Context menu vs dropdown
Pattern
Trigger
Best for
Context menu
Right-click (or long-press)
Tables, canvases, file lists
Dropdown
Click on button or row
Toolbars, row actions, sort menus
Dropdown wrapper
Custom trigger element
Composed inputs (date picker, tag field)
The context menu portals the menu to the click position. The dropdown anchors to the trigger with floating-ui placement. Both support keyboard navigation and close on outside click.
Context menu structure
Wrap the interactive surface (a table row, card, or canvas) as children. Pass menu content via the dropdown prop.Build the menu as a Column with padding, then list option rows with label and value props. Wire onSelect to route action values. closeAfterClick defaults to true so the menu dismisses after a choice.
Wrap the target surface in a Row with surface background and border so users know the area is interactive.
Prefix icons and danger actions
Add hasPrefix with an Icon on each option row for scanability. Mark destructive actions with the danger prop — it tints the label and icon toward the danger palette.Group related actions with spacing; separate Delete from safe actions with extra vertical gap.
Controlled open state
For programmatic open/close (e.g. after an async delete), pass isOpen and onOpenChange. Leave uncontrolled for standard right-click behavior.
Dropdown for click actions
The dropdown follows the same option list pattern but attaches to a visible trigger — typically a Button or IconButton.