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

react-native-material-bottom-navigation

v1.0.5

Published

A beautiful, customizable and easy-to-use Material Design Bottom Navigation for react-native.

Downloads

1,112

Readme

  • Pure JavaScript. No native dependencies. No linking. No obstacles.
  • Looks beautiful. Stunning and fluid animations. You won't believe it's not a native view.
  • Customize it. You can adjust nearly everything to make it fit perfectly to your app.
  • Easy to use. Uses established React patterns for both simple and advanced usage.
  • Pluggable. Includes customizable Tabs and Badges. Not enough? Create and use your own!

Installation

Using npm:

npm install react-native-material-bottom-navigation

Or using yarn:

yarn add react-native-material-bottom-navigation

Table of Contents

Demo

Usage

This library uses "render props" as established pattern for component composition. The example below illustrates the basic usage of the Bottom Navigation. All available Props are listed in the Documentation.

Dive into the example below, check out the example app and take a look at the Usage Documentation.

import BottomNavigation, {
  FullTab
} from 'react-native-material-bottom-navigation'

export default class App extends React.Component {
  tabs = [
    {
      key: 'games',
      icon: 'gamepad-variant',
      label: 'Games',
      barColor: '#388E3C',
      pressColor: 'rgba(255, 255, 255, 0.16)'
    },
    {
      key: 'movies-tv',
      icon: 'movie',
      label: 'Movies & TV',
      barColor: '#B71C1C',
      pressColor: 'rgba(255, 255, 255, 0.16)'
    },
    {
      key: 'music',
      icon: 'music-note',
      label: 'Music',
      barColor: '#E64A19',
      pressColor: 'rgba(255, 255, 255, 0.16)'
    }
  ]

  state = {
    activeTab: 'games'
  }

  renderIcon = icon => ({ isActive }) => (
    <Icon size={24} color="white" name={icon} />
  )

  renderTab = ({ tab, isActive }) => (
    <FullTab
      isActive={isActive}
      key={tab.key}
      label={tab.label}
      renderIcon={this.renderIcon(tab.icon)}
    />
  )

  render() {
    return (
      <View style={{ flex: 1 }}>
        <View style={{ flex: 1 }}>
          {/* Your screen contents depending on current tab. */}
        </View>
        <BottomNavigation
          activeTab={this.state.activeTab}
          onTabPress={newTab => this.setState({ activeTab: newTab.key })}
          renderTab={this.renderTab}
          tabs={this.tabs}
        />
      </View>
    )
  }
}

Note: Out-of-the-box support for React Navigation (called NavigationComponent in earlier releases) was removed with v1. Check this example for a custom React Navigation integration. Read more...

Documentation

You can also view the entire documentation on GitBook: https://timomeh.gitbook.io/material-bottom-navigation/

Notes

React Navigation Support

Check this example for a custom React Navigation integration.

In contrary to earlier releases, this library does not support React Navigation out of the box. React Navigation now ships with its own Material Bottom Navigation: createMaterialBottomTabNavigator.

You can still implement react-native-material-bottom-navigation manually by using React Navigation's Custom Navigators. Check out this example.

Updated Material Design Specs

Google updated the Material Guidelines on Google I/O 2018 with new specifications, including a slightly changed Bottom Navigation and a new "App Bar Bottom" with a FAB in a centered cutout. react-native-material-bottom-navigation uses the older specs.

Contribute

Contributions are always welcome. Read more in the Contribution Guides.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Contributors

Thanks goes to these wonderful people (emoji key):

| Timo Mämecke🐛 💻 🎨 📖 💡 🚇 🤔 👀 | Shayan Javadi💻 | David💻 | Jayser Mendez📖 | Peter Kottas💻 | Matt Oakes💻 | Keeley Carrigan💻 | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | Sean Holbert💻 | Alessandro Parolin📖 | Prashanth Acharya M📖 | Alexey Tcherevatov💻 🐛 | Trevor Atlas🐛 |

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT, © 2017 - present Timo Mämecke