0.1.2 • Published 5 years ago

react-native-tab-bars v0.1.2

Weekly downloads
10
License
MIT
Repository
github
Last release
5 years ago

Battle Tested ✅

Fully customizable navigation tab bar for React Native

npm version npm Platform - Android and iOS License: MIT styled with prettier

Installation

Add the dependency:

npm i react-native-tab-bars

Peer Dependencies

IMPORTANT! You need install them
"react": ">= 16.x.x",
"react-native": ">= 0.55.x",
"react-native-androw": ">= 0.0.34"

Usage

Import

import { SolidTabBar } from "react-native-tab-bars";

Usage

<SolidTabBar
  initial={0}
  onChange={(data) => console.log(data)}
  tabs={[
    { id: 0, text: "All" },
    { id: 1, text: "Birds" },
    { id: 2, text: "Fishes" },
    { id: 3, text: "Tigers" },
  ]}
/>

Tabs Object Array Format

[
  { id: 0, text: "All" },
  { id: 1, text: "Birds" },
  { id: 2, text: "Fishes" },
  { id: 3, text: "Tigers" },
];

Configuration - Props

PropertyTypeDefaultDescription
tabsarrayobject arrayyou have to set your object array with formatted example as above
initialnumbernulldefault selected tab
onPressfunctiondefaultset your own logic when a tab is pressed
onChangefunctiondefaultset your own logic when selected tab is changed
tabWithnumber60change the each tab's width value
tabPaddingnumber5change the each tab's padding value
shadowStylestyleshadowset your own shadow style for selected tab
shadowColorcolor#757575change the current shadow color
activeColorcolor#fbd000change the selected tab's color
inActiveColorcolortransparentchange the unselected tabs' color
activeTextColorcolor#fffchange the selected tab's text color
inactiveTextColorcolor#000change the unselected tabs' text color
ContainercomponentViewchange the main container's component type
stylestyledefaultchange or override the main container's style object

Future Plans

  • LICENSE
  • Dotted Tab Bar Component Option
  • Animation
  • Typescript Challenge!
  • Write an article about the lib on Medium

Credits

Design inspired by Sina Amiriyam

Author

FreakyCoder, kurayogun@gmail.com

License

React Native Tab Bars is available under the MIT license. See the LICENSE file for more info.