Context Menu
Opens actions on right-click or long press, with a visible menu fallback.
Preview
Local preview. It doesn't affect real accounts, environments, or run data.
Compare the same example at each size and density. Switching keeps input values and selection state. Size guidance and comparisons
Platform API build logs
Right-click or long-press for actions. The visible menu offers the same actions with keyboard and touch.
No log action taken. Logs unpinned.
Usage
Offer quick actions on a target through right-click or long press, as a secondary menu. Always pair it with a visible Menu that offers the same actions. Both paths share state and action handlers.
Don't offer important features through right-click alone. In Base UI 1.9, Trigger is a div that doesn't handle Shift+F10. Keyboard users run the same actions from the visible Menu.Trigger. Wrap only non-interactive content, not inputs or links that need the browser's native context menu.
Size: SizeProvider size="small" resizes the whole composition, including portals. The default size is Default. Size guidance and comparisons
Anatomy
Root → Trigger + Portal → Content(Positioner + Popup) → Item / CheckboxItem / SubmenuRoot
Keyboard and accessibility
Tab to the visible Menu.Trigger and press Enter or Space to open the menu. Arrow keys, Home, End, and type-ahead move between items. Enter runs an item, and Escape closes the menu. ContextMenu keeps its default pointer positioning and collision avoidance.
Give each control a name that describes its purpose. Connect error messages to their controls, and signal state with more than color. Automated checks don't replace manual keyboard and assistive technology testing.
Example code
Shared components take their styles from design tokens. Each example sets its own composition and accessibility attributes. The calling screen defines callbacks, refs, and product data.
Key API
The table lists the common wrapper's main props. See the package type declarations for the full types.