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

enhanced-fluid-bottom-navigation-bar

v0.2.4

Published

Enhanced version of 10clouds' FluidBottomNavigation for React Native

Downloads

9

Readme

Enhanced Fluid Bottom Navigation Bar

NpmVersion NpmLicense Expo

This project improves the customization of 10clouds' fluid tab bar for React Native.

What's New in 0.2.2/0.2.3:

  • Fixed and issue where Zocial icons were not being rendered properly.
  • Formatting and linting.
  • Optimized dependencies.

Changelog:

  • Added Expo compatibility by removing react-native-view-overflow and the need to link it.
  • Added integrated vector icons via @expo/vector-icons so you don't have to supply your own icons.
  • Tab bar now auto-selects first tab index on mount (this behavior is customizable).
  • Tab bar background color is now fully customizable.
  • Icon highlight color on select is now fully customizable.
  • Icon font size and font family is now fully customizable.
  • Deprecated the ability to provide image sources for icon images.
  • Removed example project in favor of expanded usage documentation.
  • Fixed an issue where the default font family causes an expo-font error in newer versions of Expo.
  • Fixed an issue where font scales poorly for long tab names when font size is not specified.

Sample

Installation

yarn (recommended)

yarn add enhanced-fluid-bottom-navigation-bar

npm

npm i enhanced-fluid-bottom-navigation-bar

Usage

Rendering Component

This component requires just 2 props:

  • onPress: a function that should handle rendering tabs.
  • values: an array of objects that contains the title and icon properties for each tab.
<TabBar
  onPress={tabIndex => { this._handlePress(tabIndex) }}
  values={[
    {
      title: 'News',      // required
      icon: 'news',       // required
      iconSet: 'Entypo',  // required
      size: 32            // required (icon will be size x size)
    }
  ]}
/>

Look up valid icon names and their corresponding icon set at the @expo/vector-icons directory.

Integration with react-navigation

  1. Define a custom component that renders TabBar with the values you want. React's tab navigator will pass navigation and onTabPress props to your component when hooked up; use these to implement the onPress callback to navigate to the appropriate route:
import TabBar from 'enhanced-fluid-bottom-navigation-bar';

class FluidTabBar extends Component {
  render() {
    return (
      <TabBar
        onPress={tabIndex => {
          const route = this.props.navigation.state.routes[tabIndex];
          this.props.onTabPress({route});
        }}
        values={[
          {
            title: 'Tab 1',
            icon: 'star',     
            iconSet: 'MaterialIcons',
            size: 32          
          }, {
            title: 'Tab 2',
            icon: 'check',     
            iconSet: 'AntDesign',
            size: 32          
          }
        ]}
      />
    );
  }
}

In this case, pressing a tab in FluidTabBar navigates to the route that shares the same array index.

  1. Create a tab navigator and supply our custom component to tabBarComponent.
import {createBottomTabNavigator} from 'react-navigation-tabs';

const myTabNavigator = createBottomTabNavigator(
  {  // RouteConfigs
    Tab1: { screen: Tab1Screen },
    Tab2: { screen: Tab2Screen },
  },
  {
    initialRouteName: 'Tab1',
    tabBarComponent: FluidTabBar,
  }
);
  1. Create an app container from your tab navigator and use it as your top-level component.
import {createAppContainer} from 'react-navigation';

const myAppContainer = createAppContainer(myTabNavigator)

Customization

Prop | Type | Default | Description --- | --- | --- | --- tintColor | String | rgb(76, 83, 221) | Icon bubble background color and text color. selectColor | String | rgb(255, 255, 255) | Icon tint or highlight color when selected. backgroundColor | String | rgb(255, 255, 255) | Tab bar background color. autoSelect | Number | 0 | Auto-selects the tab at this index on mount. fontSize | Number | undefined | Font size for tab captions. fontFamily | String | undefined | Font family for tab captions.

NOTE: fontSize and fontFamily default to React Native's standard font size and font face.

Author

Original Author: Patryk Mierzejewski

Modifications By: Victor Li

License

Available under the MIT license. See the LICENSE file for more info.