Popup menu component for React Native
Go to file
Stanislav Miklik 3a3b66010d update animation times to align with material design guidelines 2017-01-10 14:39:33 +01:00
__mocks__ configurable touchable components, resolved #16 2016-12-02 14:31:12 +01:00
__tests__ Merge branch 'closing-animation' 2017-01-10 14:29:06 +01:00
doc documented close renderer method 2017-01-09 10:37:02 +01:00
examples issue #18: improved number of renders for menu opening 2016-12-08 21:38:31 +01:00
src update animation times to align with material design guidelines 2017-01-10 14:39:33 +01:00
.babelrc initial version 2016-05-16 16:54:39 +02:00
.eslintignore linting rules for tests 2016-05-17 13:38:25 +02:00
.eslintrc different menu types 2016-05-30 16:24:43 +02:00
.gitignore jasmine reporters 2016-06-07 14:52:13 +02:00
.npmignore updated documentation 2016-11-23 13:33:54 +01:00
Jenkinsfile jenkins dev mail, refined pipeline 2016-06-08 13:50:39 +02:00
LICENSE Initial commit 2016-05-16 16:16:31 +02:00
README.md update animation times to align with material design guidelines 2017-01-10 14:39:33 +01:00
android.demo.gif slide-in menu - removed border radius 2016-05-31 14:37:08 +02:00
package.json release v 0.6.1 2016-12-08 21:42:17 +01:00
setup-jasmine-env.js jasmine reporters 2016-06-07 14:52:13 +02:00

README.md

react-native-popup-menu

Extensible popup menu component for React Native for both Android and iOS.

Features:

  • Simple to use popup/context menu
  • Multiple modes: animated, not animated or slide in from bottom
  • By default opening and closing animations
  • Easy styling
  • Customizable on various levels - menu options, positioning, animations
  • Can work as controlled as well as uncontrolled component
  • Different lifecycle hooks

Popup menu

Installation

npm install react-native-popup-menu --save

Basic Usage

Wrap your application inside MenuContext and then simply use Menu component where you need it. Below you can find a simple example.

For more detailed documentation check API.

import React from 'react';
import { Text } from 'react-native';
import Menu, {
  MenuContext,
  MenuOptions,
  MenuOption,
  MenuTrigger,
} from 'react-native-popup-menu';

export const App = () => (
  <MenuContext>
    <Text>Hello world!</Text>
    <Menu onSelect={value => alert(`Selected number: ${value}`)}>
      <MenuTrigger text='Select option' />
      <MenuOptions>
        <MenuOption value={1} text='One' />
        <MenuOption value={2}>
          <Text style={{color: 'red'}}>Two</Text>
        </MenuOption>
        <MenuOption value={3} disabled={true} text='Three' />
      </MenuOptions>
    </Menu>
  </MenuContext>
);

Documentation

Demo

![](./android.demo.gif)