All Projects → mpiannucci → React Native Context Menu View

mpiannucci / React Native Context Menu View

Use native context menus in React Native

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Context Menu View

Client Dependencies Gradle
Install client dependencies from NPM, Bower or Git
Stars: ✭ 89 (-11.88%)
Mutual labels:  npm
Vue Csv Import
Vue.js component to select a CSV file, map the columns to fields, and post it somewhere.
Stars: ✭ 95 (-5.94%)
Mutual labels:  npm
Config Chain
Handle configuration once and for all
Stars: ✭ 98 (-2.97%)
Mutual labels:  npm
Event Target Shim
An implementation of WHATWG EventTarget interface, plus few extensions.
Stars: ✭ 89 (-11.88%)
Mutual labels:  npm
Doge
Darknet Osint Graph Explorer
Stars: ✭ 93 (-7.92%)
Mutual labels:  npm
Tplink Cloud Api
A node.js npm module to remotely control TP-Link smartplugs (HS100, HS110) and smartbulbs (LB100, LB110, LB120, LB130) using their cloud web service (no need to be on the same wifi/lan)
Stars: ✭ 96 (-4.95%)
Mutual labels:  npm
Postinstall Build
Helper for conditionally building your npm package on postinstall
Stars: ✭ 87 (-13.86%)
Mutual labels:  npm
Node Sonic Channel
🦉 Sonic Channel integration for Node. Used in pair with Sonic, the fast, lightweight and schema-less search backend.
Stars: ✭ 101 (+0%)
Mutual labels:  npm
Npm Pipeline Rails
Use npm as part of your Rails asset pipeline
Stars: ✭ 93 (-7.92%)
Mutual labels:  npm
Geotic
Entity Component System library for javascript
Stars: ✭ 97 (-3.96%)
Mutual labels:  npm
Npmarket
🛒 More efficient search for node packages.
Stars: ✭ 91 (-9.9%)
Mutual labels:  npm
React Anime
✨ (ノ´ヮ´)ノ*:・゚✧ A super easy animation library for React!
Stars: ✭ 1,313 (+1200%)
Mutual labels:  npm
Lmify
Install NPM dependencies programmatically 🤙
Stars: ✭ 98 (-2.97%)
Mutual labels:  npm
Ungrid
ungrid - the simplest responsive css grid
Stars: ✭ 1,292 (+1179.21%)
Mutual labels:  npm
Cryptocurrency Cli
💰 Cryptocurrency Portfolio On The Command Line 💰
Stars: ✭ 99 (-1.98%)
Mutual labels:  npm
Nps
NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
Stars: ✭ 1,285 (+1172.28%)
Mutual labels:  npm
Npm Introspect
🔎 Introspect is a tool to traverse the NPM ecosystem and identify quality modules. Use the CLI to upload and examine your project's dependencies.
Stars: ✭ 95 (-5.94%)
Mutual labels:  npm
String To Color
Time invariant color from any object.
Stars: ✭ 101 (+0%)
Mutual labels:  npm
Npm Quick Run
Quickly run NPM script by prefix without typing the full name
Stars: ✭ 97 (-3.96%)
Mutual labels:  npm
Democracy Client
DEMOCRACY App Client
Stars: ✭ 98 (-2.97%)
Mutual labels:  npm

react-native-context-menu-view

Use native context menu functionality from React Native. On iOS 13+ this uses UIMenu functionality, and on Android it uses a PopUpMenu.

On iOS 12 and below, nothing happens. You may wish to do a Platform.OS === 'ios' && parseInt(Platform.Version, 10) <= 12 check, and add your own onLongPress handler.

Getting started

$ npm install react-native-context-menu-view --save

Mostly automatic installation

cd ios/
pod install

Usage

import ContextMenu from "react-native-context-menu-view";

const Example = () => {
  return (
    <ContextMenu
      actions={[{ title: "Title 1" }, { title: "Title 2" }]}
      onPress={(e) => {
        console.warn(
          `Pressed ${e.nativeEvent.name} at index ${e.nativeEvent.index}`
        );
      }}
    >
      <View style={styles.yourOwnStyles} />
    </ContextMenu>
  );
};

See example/ for basic usage.

Props

title

Optional. The title above the popup menu.

actions

Array of { title: string, systemIcon?: string, destructive?: boolean, disabled?: boolean, inlineChildren?: boolean, children?: Array<ContextMenuAction> }.

System icon refers to an icon name within SF Symbols.

Destructive items are rendered in red on iOS, and unchanged on Android.

Nested menus are supported on iOS only and result in nested UIMenu which can be optionally displayed inline.

onPress

Optional. When the popup is opened and the user picks an option. Called with { nativeEvent: { index, name } }. When a nested action is selected the top level parent index is used for the callback.

onCancel

Optional. When the popop is opened and the user cancels.

previewBackgroundColor

Optional. The background color of the preview. This is displayed underneath your view. Set this to transparent (or another color) if the default causes issues.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].