npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

curved-bottom-navigation-bar

v2.0.5

Published

Hight performance animated bottom navigation bar for both Android and IOS

Downloads

234

Readme

High performance animated bottom navigation bar for both Android and IOS 😎 with react navigation v5 or higher.


Table of Contents

Installation

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

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

Usage

import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import AnimatedTabBar, {TabsConfigsType} from 'curved-bottom-navigation-bar';
import {SafeAreaProvider} from 'react-native-safe-area-context';
const tabs: TabsConfigsType = {
    Home: {
        icon: ({ progress, focused }) => /* Icon Component */,
        renderTitle: ({ progress, title }) => /* Custom reanimated Component */
    },
    Profile: {
        icon: ({ progress, focused }) => /* Icon Component */,
        renderTitle: ({ progress, title }) => /* Custom reanimated 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>
  )
}

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.SharedValue<number>; // Reanimated - 0 is not Active, 1 is Active
  focused: boolean;
}

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

export default AnimatedIcon;

Animated Title

Custom title value for tabbar

This example below should explain it better:

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


interface AnimatedTitleProps {
  progress: Animated.SharedValue<number>; // Reanimated - 0 is not Active, 1 is Active
  title:string;
}

const AnimatedTitle = ({ progress, title }: AnimatedTitleProps) => {
  return (
   /* DO SOME THING */
  );
};

export default AnimatedTitle;

Props

| name | required | default | description | | -------------- | -------- | -------------------------------- | --------------------------------------------------------------------------- | | duration | NO | 500 | Duration for the tabs animation. | | barColor | NO | #FFFFFF | background color of bottom bar. | | tabs | YES | | A dictionary for all tabs configurations, check TabConfigsType interface. | | dotSize | NO | 60 | Size of dot. | | dotColor | NO | #FFFFFF | Color of dot. | | titleShown | NO | false | Whether to show or hide the title for the bottom bar |

TabConfigsType

| name | required | default | description | | --------------- | -------- | ------- | ---------------------------------------------------------------------------------- | | icon | YES | | Component to be render as tab icon, it will recevie an animated node prop progress. | renderTitle | NO | | Component to be render as tab title, it will recevie an animated node prop progress and title.

Built With

License

MIT