This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
ContextMenu
A SwiftUI ContextMenu component for displaying context menus.
Expo UI ContextMenu matches the official SwiftUI contextMenu API and displays a menu when long-pressed. For single-tap menu interactions, use Menu instead.
Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
Basic context menu
Context menu with system images
Context menu with preview
Use ContextMenu.Preview to show a custom preview above the menu when opened.
Context menu with picker
Context menu with sections
Use Section and Divider components to organize menu items.
Nested context menus
Use nested ContextMenu components to create submenus.
API
import { ContextMenu } from '@expo/ui/swift-ui';
Components
Type: React.Element<ContextMenuProps>
ContextMenu allows you to create a context menu, which can be used to provide additional options to the user.
Props of the ContextMenu component.
ReactNodeThe contents of the context menu.
Should include ContextMenu.Trigger, ContextMenu.Items, and optionally ContextMenu.Preview.
Type: React.Element<{
children: ReactNode
}>
Items visible inside the context menu. It could be Section, Divider, Button, Toggle, Picker or even ContextMenu itself for nested menus. Remember to use components from the @expo/ui/swift-ui library.