Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
react-native-material-bottom-navigation
Advanced tools
A beautiful, customizable and easy-to-use Material Design Bottom Navigation for react-native.
A beautiful, customizable and easy-to-use
Material Design Bottom Navigation for react-native.
Using npm:
npm install react-native-material-bottom-navigation
Or using yarn:
yarn add react-native-material-bottom-navigation
Shifting Tab
Full Tab
Icon Tab
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...
You can also view the entire documentation on GitBook: https://timomeh.gitbook.io/material-bottom-navigation/
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.
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.
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.
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!
MIT, © 2017 - present Timo Mämecke
FAQs
A beautiful, customizable and easy-to-use Material Design Bottom Navigation for react-native.
We found that react-native-material-bottom-navigation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.