Popup menu component for React Native
Go to file
Martin Bielik c7495847b6 added named Menu import 2017-01-19 11:35:27 +01:00
__mocks__ configurable touchable components, resolved #16 2016-12-02 14:31:12 +01:00
__tests__ Revert "reduced views in trigger" 2017-01-11 13:28:31 +01:00
doc trigger outer container styles 2017-01-19 11:34:18 +01:00
examples trigger outer container styles 2017-01-19 11:34:18 +01:00
src trigger outer container styles 2017-01-19 11:34:18 +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 added named Menu import 2017-01-19 11:35:27 +01:00
android.demo.gif slide-in menu - removed border radius 2016-05-31 14:37:08 +02:00
package.json release 0.7.0 2017-01-11 13:58:08 +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)