Giter VIP home page Giter VIP logo

react-native-navbar-wrapper's Introduction

react-native-navbar

Navigation bar component for react native

Example: Github repo of this app

alt tag

Download from npm

     npm i react-native-navbar-wrapper

Example Use:-

     import NavbarWrapper from 'react-native-navbar-wrapper';

Inside render function

     <NavbarWrapper
        hasBack={true}   // true or false
        backPressed={this.backPressed}
        show={true}   //  true or false
        title={"App title "}
        openMenu={this.openMenu}
        closeMenu = {this.closeMenu}
        initialRoute={{name:'PageOne', title:'Page One'}}
        renderScene={this.renderScene}
        setNavigator={ this._setNavigator} //use this function if you want to get navigator reference
        configureScene={this.configureScene}
        menuItemSelected = {this._menuItemSelected}
        isMenuOpen = {true} // true or false
        backIcon = {backIcon}  // left button icon
        menuIcon = {menuIcon}  // right button icon
        menuItems = {["button1" , "button2" , "button3"]}  // buttons in menu
        sceneStyle={{}}  // style
      />

#Required Properties:- #

renderScene

renderScene function, something like->

renderScene = (route, navigator) =>{ switch(route.name) { case "pageOne": return (); case "pageTwo": return (); } };

#

configureScene

configureScene function , example

configureScene = () => { return Navigator.SceneConfigs.FloatFromRight; }; #

initialRoute

initialRoute, example

initialRoute = {name: 'pageOne'} #

sceneStyle

scene style, eg:

sceneStyle={{flex:1, backgroundColor:'white'}}

#Optional Properties:-

#

hasBack

True to enable back button otherwise false

#

backPressed

Handler function for back button clicked

#

setNavigator

setNavigator function , use this as callback function to set navigator reference for example:

_setNavigator = (nav) =>{ this.navigator = nav; };

style for navigation bar can be passed through this property

navbarStyle : {{}}

Use this to change statusBar color in Android

statusBarColor :  'cyan'

Use this to change status bar style in iOS , Check possible values in official react native doc https://facebook.github.io/react-native/docs/statusbar.html#barstyle

statusBarStyle ={"light-content"}

Menu in right side is optional to set menuIcon pass reference of image in this parameter

 menuIcon = {menuIconRef} 

List of action button in menu

menuItems = {["button1" , "button2" , "button3"]}  

react-native-navbar-wrapper's People

Contributors

abhishekcode avatar

Watchers

 avatar  avatar  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.