0.1.1 • Published 3 years ago

react-native-animated-bottom-tabs v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-native-animated-bottom-tabs

An animated bottom tabbar for react-native-bottom-tabs

Installation

npm install react-native-animated-bottom-tabs
or
yarn add react-native-animated-bottom-tabs

Usage

import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import TabBar from 'react-native-animated-bottom-tabs';

// ...

const TabNavigator = createBottomTabNavigator();

const Tabs = () => {
  return (
    <TabNavigator.Navigator tabBar={(props) => <TabBar {...props} />}>
      <TabNavigator.Screen
        name="Home"
        component={HomeScreen}
        options={{
          tabBarIcon: () => (
            <Image source={require('../assets/home.png')} style={styles.icon} />
          ),
        }}
      />
      <TabNavigator.Screen
        name="Settings"
        component={SettingsScreen}
        options={{
          tabBarIcon: () => (
            <Image
              source={require('../assets/settigs.png')}
              style={styles.icon}
            />
          ),
        }}
      />
      <TabNavigator.Screen
        name="Profile"
        component={ProfileScreen}
        options={{
          tabBarIcon: () => (
            <Image
              source={require('../assets/profile.png')}
              style={styles.icon}
            />
          ),
        }}
      />
    </TabNavigator.Navigator>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  icon: { height: 20, width: 20, tintColor: 'white' },
});

Props

PropTypeDefaultDescription
position"Fixed","Float""Float""Fixed" - Tab bar is fixed to bottom, "Float" - Tab bar is floating
tabBarStyleViewProps-Style for Tab bar
activeContainerStyleViewProps-Style for Active Cell
reverseLabelSelectionBooleanfalseif true, the selected style is reversed
labelStyleTextProps-Style for Label

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT