Skip to main content

ContextMenu

iOS Android
ContextMenu on iOS ContextMenu on Android

Native context menu that wraps content and responds to long-press or tap gestures.

Props

PropTypeDescription
titlestringMenu title (shown as header on iOS)
actionsContextMenuAction[]Array of menu actions
disabledbooleanDisables the menu
trigger'longPress' | 'tap'How the menu opens (default: 'longPress')
onPressAction(actionId, actionTitle) => voidCalled when user selects an action
onMenuOpen() => voidCalled when menu opens
onMenuClose() => voidCalled when menu closes
childrenReactNodeContent to wrap (required)

ContextMenuAction

PropertyTypeDescription
idstringUnique identifier returned in callbacks
titlestringDisplay text
subtitlestringSecondary text (iOS only)
imagestringIcon name (SF Symbol on iOS, drawable on Android)
imageColorstringTint color for the icon (hex string)
attributes{ destructive?, disabled?, hidden? }Action attributes
state'off' | 'on' | 'mixed'Checkmark state
subactionsContextMenuAction[]Nested actions for submenu

iOS Props (ios)

PropTypeDescription
enablePreviewbooleanEnable preview when long-pressing

Android Props (android)

PropTypeDescription
anchorPosition'left' | 'right'Anchor position for the popup menu
visiblebooleanProgrammatic visibility control (Android only)

Trigger Modes

  • Long-Press (default): Long-press on wrapped content triggers the menu.
  • Tap (trigger="tap"): Single tap on wrapped content triggers the menu.
  • Programmatic (Android only): Use android.visible to control menu visibility programmatically. iOS does not support programmatic menu opening due to platform limitations.

Icon Support

  • iOS: Use SF Symbol names (e.g., 'trash', 'square.and.arrow.up', 'doc.on.doc')
  • Android: Use drawable resource names or Material icon names