1.0.5 • Published 6 years ago

react-native-tab-bar-footer v1.0.5

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

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

npm.io npm.io

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

PropDefaultTypeDescription
tabs[]Array<Tab>Tab objects
initialIndex0numberInitial active tab
onTabChangeundefinedfunconClick tab
slideSpeed25numbertabBar animation speed
slideBounciness10numbertabBar bounciness
tabSize30numbertab size
barColor'white'colortabBar color
height60numbertabBar height
titleStyle-styletitle custom style
iconStyle-styleicon custom style
animationDuration200numberanimation duration
ripplePropsrippleCenteredobjectRipple component props
hat<View/>React.Element<*>Custom active hat component
hatWidth78numberActive hat component width
hatHeight78numberActive 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