0.1.5 • Published 7 years ago

react-native-smartbar v0.1.5

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

react-native-smartbar

Maybe this is the best tabbar. 中文

Install

* install with npm
sudo npm i react-native-smartbar --save

Get Started

  • DEMO

    Witt Bulter

  • toggle the bar

    Witt Bulter

  • only image

    If you just want to show the image, do not fill in [text(TabBar.Item)]

    Witt Bulter

  • only text

    If you just want to show the text, do not fill in image(TabBar.Item) Witt Bulter

documentation

  • TabBar
attributetyperequireddescriptionexample
activeColorstringfalseactive coloractiveColor={'#FE985B'}
toggleBarboolfalsehide and showtoggleBar={this.state.toggle}
heightnumberfalsedefault value = 45pxheight={50}
indexnumberfalsejump index and default indexindex={this.state.index}
stylestylefalsefooter bar stylestyle={{height: 500}}
  • TabBar.Item
attributetyperequireddescriptionexample
iconimagefalsedefault iconicon={require('./img/abc.png')}
selectedIconimagefalseactive iconicon={require('./img/abc_2.png')}
textstringfalsedefault texttext={'List'}
stylestylefalsefooter bar stylestyle={{height: 500}}

Features

  1. Show and hide

        <TabBar
               // ...
                ref={tabbar=> this.tabbar=tabbar}
        >
    
        // you can pass the handle to the next page
        // toggle 
        this.tabbar.toggleBar()
     
        // OR set bool
        this.tabbar.toggleBar(true)
        this.tabbar.toggleBar(false)

    OR ...

    // use redux
       <TabBar
              // ...
               toggleBar={this.state.toggle}
       >
    
       // toggle 
       componentWillReceiveProps (nextProps){
       		this.setState({
       			toggle: nextProps.toggle
       		})
       }
        
  2. Jump

        <TabBar
               // ...
                ref={tabbar=> this.tabbar=tabbar}
        >
     
        // jump
        this.tabbar.jumpToIndex(index)
     

    OR ...

       <TabBar
              // ...
               index={this.state.index}
       >
    
       // jump 
       componentWillReceiveProps (nextProps){
            this.setState({
                index: nextProps.index
            })
       }
        
  3. Customize

    You can customize any style !

       <TabBar
              // ...
               style={{...}}
       >
           <TabBar.Item
               // ...
               style={{...}}
            >
               <Index />
            </TabBar.Item>    
       </TabBar>
        

Example

see /example

Support

  • MAIL (# = @) => nanazuimeng123#gmail.com
  • ISSUES