Code Monkey home page Code Monkey logo

react-native-tab-bar-footer's Introduction

react-native-tab-bar-footer

npm version npm version

Navigation TabBar footer component for IOS and Android with slide animation which contains tab icon (normal and active) and title. You can use custom hat React Element (component above the active tab), if you use custom hat please provide also hatWidth and hatHeight.

In this lib I'm using Ripple component.

Installation

yarn add react-native-tab-bar-footer

Usage

import TabBar from 'react-native-tab-bar-footer'
...
  const tabs = [
    {
      icon: star,
      activeIcon: starActive,
      title: 'Favorites'
    },
    {
      icon: play,
      activeIcon: playActive,
      title: 'Play'
    },
    {
      icon: user,
      activeIcon: userActive,
      title: 'Profile'
      
    },
  ]
  render() {
    return <TabBar onTabChange={(index) => alert(index)} tabs={tabs} />
  }

Props

Prop Default Type Description
tabs [] Array<Tab> Tab objects
initialIndex 0 number Initial active tab
onTabChange undefined func onClick tab
slideSpeed 25 number tabBar animation speed
slideBounciness 10 number tabBar bounciness
tabSize 30 number tab size
barColor 'white' color tabBar color
height 60 number tabBar height
titleStyle - style title custom style
iconStyle - style icon custom style
animationDuration 200 number animation duration
rippleProps rippleCentered object Ripple component props
hat <View/> React.Element<*> Custom active hat component
hatWidth 78 number Active hat component width
hatHeight 78 number Active hat component height

Tab object structure:

type Tab = { 
  icon: string|number, 
  activeIcon: string|number, 
  title: string
}

Questions or suggestions?

Feel free to open an issue

react-native-tab-bar-footer's People

Contributors

artemkosiakevych avatar

Stargazers

Gökhan Doğru avatar Luiz Carlos Pedroso Gomes avatar  avatar

Watchers

Dipen Patel avatar  avatar

Forkers

bhavika162

react-native-tab-bar-footer's Issues

Warning: componentWillReceiveProps

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
  • Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

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.