Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

curved-bottom-navigation-bar

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curved-bottom-navigation-bar

Hight performance animated bottom navigation bar for both Android and IOS

  • 0.7.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
63
increased by23.53%
Maintainers
1
Weekly downloads
 
Created
Source

Curved Navigation Bar

Hight performance animated bottom navigation bar for both Android and IOS 😎.


Table of Contents

  1. Installation
  2. Usage
  3. Props
  4. Credits
  5. License

Installation

yarn add curved-navigation-bar
# or
npm install curved-navigation-bar

Also, you need to install react-native-reanimated, react-native-gesture-handler & react-native-svg, and follow theirs installation instructions.

Usage

React Navigation v5
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import AnimatedTabBar, {TabsConfigsType} from '@hngocl/curved-navigation-bar';
import {SafeAreaProvider} from 'react-native-safe-area-context';
const tabs: TabsConfigsType = {
    Home: {
        icon: ({ progress }) => /* ICON COMPONENT */
    },
    Profile: {
        icon: ({ progress }) => /* ICON COMPONENT */
    },
}

const Tab = createBottomTabNavigator();

export default function App() {
  return (
  <SafeAreaProvider>
    <NavigationContainer>
      <Tab.Navigator
        tabBar={props => (
          <AnimatedTabBar tabs={tabs} {...props} />
        )}
      >
        <Tab.Screen
          name="Home"
          component={HomeScreen}
        />
        <Tab.Screen
          name="Profile"
          component={ProfileScreen}
        />
      </Tab.Navigator>
    </NavigationContainer>
  </SafeAreaProvider>
  )
}
React Navigation v4
import React from 'react';
import {createAppContainer} from 'react-navigation';
import {createBottomTabNavigator} from 'react-navigation-tabs';
import {createStackNavigator} from 'react-navigation-stack';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import AnimatedTabBar, {TabsConfigsType} from '@hngocl/curved-navigation-bar';

const tabs: TabsConfigsType = {
    Home: {
        icon: ({ progress }) => /* ICON COMPONENT */
    },
    Profile: {
        icon: ({ progress }) => /* ICON COMPONENT */
    },
}

const TabNavigator = createBottomTabNavigator(
  {
    Home: HomeScreen,
    Profile: ProfileScreen,
  },
  {
    tabBarComponent: props => <AnimatedTabBar tabs={tabs} {...props} />,
  },
);

const AppContainer = createAppContainer(TabNavigator);

export default () => (
  <SafeAreaProvider>
    <AppContainer />
  </SafeAreaProvider>
);

Animated Icon

In order to animate the tab icon color, you will need to use the provded prop color that will be provided to the icon.

This example below should explain it better:

import React from 'react';
import Animated from 'react-native-reanimated';


interface AnimatedIconProps {
  progress: Animated.Node<number>; // Reanimated - 0 is not Active, 1 is Active
}

const AnimatedIcon = ({ progress }: AnimatedIconProps) => {
  return (
   /* DO SOME THING */
  );
};

export default AnimatedIcon;

Props

namerequireddefaultdescription
durationNO500Duration for the tabs animation.
barColorNO#FFFFFFbackground color of bottom bar.
tabsYESA dictionary for all tabs configurations, check TabConfigsType interface.
sizeDotNO60Size of dot.
dotColorNO#FFFFFFColor of dot.

TabConfigsType

namerequireddefaultdescription
iconYESComponent to be render as tab icon, it will recevie an animated node prop progress.

Curved Preview

Built With

License

MIT


Keywords

FAQs

Package last updated on 30 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc