@hmodarres/react-native-ios-context-menu
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

React Native iOS Context Menu

Use iOS context menus in your React Native app.

Apple Developer Documentation


media

API documentation


Get Started

Installation in managed Expo projects

This package requires a development build of Expo to run as it contains custom native code. To create a development build, please refer to Creating a Development Build

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npm install react-native-ios-context-menu

Configure for iOS

npx pod-install

Usage

Simply wrap the view you want to add context menu to with ContextMenu:

import { Text } from "react-native";
import { ContextMenu } from "react-native-ios-context-menu";

const Example = () => {
  return (
    <ContextMenu
      menu={{
        type: "menu",
        title: "Sample Menu",
        children: [
          { type: "action", title: "Notify Me" },
          { type: "action", title: "Undo" },
          { type: "action", title: "Mark" },
        ],
      }}
    >
      <Text>Press Me</Text>
    </ContextMenu>
  );
};

Package Sidebar

Install

npm i @hmodarres/react-native-ios-context-menu

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

248 kB

Total Files

106

Last publish

Collaborators

  • hmodarres