Giter Club home page Giter Club logo

react-native-expandable-menu's Introduction

react-native-expandable-menu

react native expandable menu component for ios and android

Demo

Alt Text

Installation

npm install react-native-expandable-menu

Getting started

import ExpandableMenu from '../src/ExpandableMenu/ExpandableMenu';

import the an images of your choice

const plus = require('./img/plus.png');
const musicalNote = require('./img/musicalNote.png');
const location = require('./img/location.png');
const camera = require('./img/camera.png');
const pencil = require('./img/pencil.png');
const erasor = require('./img/eraser.png');

create an array of menu items

const menuItems = [
  {
    img: musicalNote,
    title: 'music',
    onPress: (index, title) => console.log(index, title),
  },
  {
    img: location,
    title: 'location',
    onPress: (index, title) => console.log(index, title),
  },
  {
    img: camera,
    title: 'camera',
    onPress: (index, title) => console.log(index, title),
  },
  {
    img: pencil,
    title: 'pencil',
    onPress: (index, title) => console.log(index, title),
  },
  {
    img: erasor,
    title: 'erasor',
    onPress: (index, title) => console.log(index, title),
  },
]

lastly, provide expanding button and menu items

export default class App extends Component {
  render() {
    return (
      <View style={ styles.container }>
        <ExpandableMenu
          expandingButton={ plus }
          menuItems
        />
      </View>
    );
  }
}

API

Props Type Description Default
expandingButton img button to expand menu items null
menuItems img list of menu item when toggle on and off []
expandDuration number speed when expanding menu items 600
collapseDuration number speed when collapsing menu items 1000
displacement number space between menu items when expand 50

Contribution

pull requests and issue are always welcome to enhance the component

react-native-expandable-menu's People

Contributors

tuyenle92 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.