1.0.2 • Published 7 years ago

react-native-falling-drawer v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

react-native-falling-drawer

Customizable falling drawer for React Native

Installation

$ npm install react-native-falling-drawer --save

then

import React, { Component } from 'react';
import {
  Text,
} from 'react-native'
import FallingDrawer from 'react-native-falling-drawer'

const SCREENS = [
  {
    key: "profile",
    name: "Profile",
    color: "red",
    titleColor: "#fff",
    hamburgerColor: "#fff",
    render: () => <View><Text>This is profile screen</Text></View>
  }
]

  render() {
    return (
        <FallingDrawer screens={SCREENS}/>
    );
  }
}

Refer to the Example

Available props:

proptypedescriptiondefault
screensarrayAn array of sceens to switch between
headerHeightnumberHeight of the headerios: 60, android: 50
shakeDurationnumberShake effect duration in ms800
optionCollapseSpeednumberCollapse speed of the options in ms150
optionCollapseDelaynumberDelay between each option animation in ms200
diversifyAnimationsbooleanIf true, it applies bounce, shake and swing animations to the options, otherwise only shaketrue

screens:

Each screen in the screens array is an object which looks like this:

{
    key: "profile",            // unique key among all screens
    name: "Profile",           // header and option title 
    color: "red",              // header and option color
    titleColor: "#fff", 
    hamburgerColor: "#fff",
    render: () => {...}        // specifies how the screen is rendered
    customHeader: () => {...}  // custom header and option
}

License

MIT