TrademarkTrademark
Docs
Ctrl k
Search docs...
Components

ContextMenu

Updated: October 18, 2026
View on GitHub
Soon
Not released yet. This is on main and is not in any published version yet. It will not install today.

ContextMenu opens a menu when the user long-presses its children. The menu opens at the press point, with its top-left corner under the finger by default. Near an edge of the screen it opens on the other side of the point. It uses the same menu as DropdownWrapper: pressing outside it or the back button closes it. See the web ContextMenu page for the web version.

Basic usage

Wrap the element and pass the menu's content, usually Options. Pressing an option calls onSelect with its value and closes the menu.

Pressable children

A pressable child, such as a Button, keeps its own onPress for a short press. A long press opens the menu after the child's own onLongPress.

Controlled and disabled

Pass open and onOpenChange to control the menu. disabled ignores long presses and dims the children.

Differences from the web

  • A long press opens the menu, in place of a right-click or Control-click. A screen reader's long press has no point, so the menu opens under the children, as the web does for a menu opened from the keyboard. There is no haptic feedback.
  • The long press reaches a pressable child through its onLongPress. A child that is pressable but does not pass onLongPress on to its Pressable does not open the menu. With several children, the long press is only caught outside pressable ones.
  • onSelect, selectedOption and closeAfterClick reach the Options written in dropdown, as in DropdownWrapper.
  • There is no contents mode or className, and no arrow-key navigation. The region around the children sits at its content's width unless fillWidth is set.

API reference

Prop
Type
Default
Description
childrenReactNodeWhat a long press opens the menu on. Required.
dropdownReactNodeThe menu's content, usually Options. Required.
placementPlacement"bottom-start"Which side of the press point the menu opens on, and which edge lines up with it.
openbooleanThe open state, controlled.
onOpenChange(open: boolean) => voidCalled when the menu opens or closes.
onSelect(value: string) => voidCalled with a pressed Option's value.
selectedOptionstringMarks the Option with this value as selected.
closeAfterClickbooleantrueCloses the menu when an Option is pressed.
disabledbooleanfalseIgnores long presses and dims the children.
fillWidthbooleanfalseThe region around the children fills its container's width.
minWidthnumber12The menu's minimum width, in rem.
maxWidthnumberThe menu's maximum width, in rem.
minHeightnumberThe menu's minimum height, in points.
styleStyleProp<ViewStyle>Style for the region around the children.
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club