Stanislav Miklik 07357f542f fix: 3rd render seems to be needed
since actual renderer can (and is) different from "naked" options (e.g. fixed width etc)
2016-12-05 14:15:04 +01:00
2016-12-05 13:19:42 +01:00
2016-12-05 14:15:04 +01:00
2016-05-16 16:54:39 +02:00
2016-05-17 13:38:25 +02:00
2016-05-30 16:24:43 +02:00
2016-06-07 14:52:13 +02:00
2016-11-23 13:33:54 +01:00
2016-06-08 13:50:39 +02:00
2016-05-16 16:16:31 +02:00
2016-12-02 15:46:35 +01:00
2016-06-07 14:52:13 +02:00

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
  • 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)
S
Description
Popup menu component for React Native
Readme ISC
3.3 MiB
Languages
JavaScript 100%