2.2.36 ā€¢ Published 1 year ago

rn-wave-bottom-bar v2.2.36

Weekly downloads
6
License
MIT
Repository
github
Last release
1 year ago

rn-wave-bottom-bar semantic-release Build Status Known Vulnerabilities CodeFactor

Sample

Custom animated bottom-tab-bar for react-native.

šŸ’¾ Installation

Make sure you installed react-native-safe-area-context before installing the library

yarn add rn-wave-bottom-bar

or

npm install rn-wave-bottom-bar --save

šŸ“‹ Requirements

āš’ļø Usage

<Tab.Navigator
  screenOptions={{
    tabBarActiveTintColor: '#5F0B65',
    tabBarActiveBackgroundColor: '#5F0B65',
    tabBarInactiveBackgroundColor: 'red',
  }}
  tabBar={(props) => (
    <BottomFabBar
      mode={'square' | 'default'}
      isRtl={false}
      // Add Shadow for active tab bar button
      focusedButtonStyle={{
        shadowColor: '#000',
        shadowOffset: {
          width: 0,
          height: 7,
        },
        shadowOpacity: 0.41,
        shadowRadius: 9.11,
        elevation: 14,
      }}
      // - You can add the style below to show screen content under the tab-bar
      // - It will makes the "transparent tab bar" effect.
      bottomBarContainerStyle={{
        position: 'absolute',
        bottom: 0,
        left: 0,
        right: 0,
      }}
      {...props}
    />
  )}
>
  <Tab.Screen
    options={{
      tabBarIcon: tabBarIcon('aliwangwang-o1'),
    }}
    name="Home"
    component={generateScreen('Home')}
  />
  <Tab.Screen
    name="Meh"
    options={{ tabBarIcon: tabBarIcon('meh') }}
    component={generateScreen('Meh')}
  />
  <Tab.Screen
    options={{
      tabBarIcon: tabBarIcon('rocket1'),
      tabBarActiveBackgroundColor: '#45014A',
      tabBarActiveTintColor: 'purple',
    }}
    name="Settings"
    component={SettingsScreen}
  />
  <Tab.Screen
    options={{ tabBarIcon: tabBarIcon('Trophy') }}
    name="Trophy"
    component={generateScreen('Trophy')}
  />
  <Tab.Screen
    options={{ tabBarIcon: tabBarIcon('wallet') }}
    name="Wallet"
    component={generateScreen('Wallet')}
  />
</Tab.Navigator>

šŸ”§ Props

PropTypeDescription
springConfigAnimated.SpringConfigSpring config for the animation

āš’ļø Usage with react-navigation v5

Install the version 1.0.3 :

yarn add rn-wave-bottom-bar@1.0.3
const Tab = createBottomTabNavigator();

const tabBarIcon =
  (name: string) =>
  ({
    focused,
    color,
    size,
  }: {
    focused: boolean;
    color: string; // Defines fab icon color
    size: number;
  }) =>
    <Icon name={name} size={28} color={focused ? 'white' : 'white'} />;

<NavigationContainer>
  <Tab.Navigator
    tabBarOptions={{
      activeTintColor: 'purple', // Used for the FAB background Color
    }}
    tabBar={(props) => <BottomFabBar color="purple" {...props} />}
  >
    <Tab.Screen
      options={{ tabBarIcon: tabBarIcon('aliwangwang-o1') }}
      name="Home"
      component={generateScreen('Home')}
    />
    <Tab.Screen
      name="Account"
      options={{ tabBarIcon: tabBarIcon('meh') }}
      component={generateScreen('Meh')}
    />
  </Tab.Navigator>
</NavigationContainer>;

Migration

TabBar:

tabBarOptions.activeTintColor -> screenOptions.tabBarActiveBackgroundColor

BottomFabBar :

color -> focusedButtonStyle

šŸ“„ Credits

Thanks to W.Candillon for the tuto : https://www.youtube.com/watch?v=6LsLgHeX500

Initial Design : https://uimovement.com/design/tab-bar-3/

Compatibility

āœ… Works well with mosts Devices and tested on iPad, IPhones, Android Devices.

āœ… Support device orientation.

āœ… RTL support. (thanks darkhorse-coder)

More

šŸ“Œ Checkout our other libraries :

2.2.17

1 year ago

2.2.18

1 year ago

2.2.15

1 year ago

2.2.16

1 year ago

2.2.35

1 year ago

2.2.13

1 year ago

2.2.36

1 year ago

2.2.14

1 year ago

2.2.33

1 year ago

2.2.11

1 year ago

2.2.34

1 year ago

2.2.12

1 year ago

2.2.31

1 year ago

2.2.32

1 year ago

2.2.10

1 year ago

2.2.30

1 year ago

2.2.9

1 year ago

2.2.8

1 year ago

2.2.19

1 year ago

2.2.26

1 year ago

2.2.27

1 year ago

2.2.24

1 year ago

2.2.25

1 year ago

2.2.22

1 year ago

2.2.23

1 year ago

2.2.20

1 year ago

2.2.21

1 year ago

2.2.1

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.2.5

1 year ago

2.2.4

1 year ago

2.2.7

1 year ago

2.2.6

1 year ago

2.2.0

2 years ago

2.1.3

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago