mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-10 17:23:42 +08:00
- @react-navigation/bottom-tabs@5.0.0-alpha.3 - @react-navigation/core@5.0.0-alpha.2 - @react-navigation/drawer@5.0.0-alpha.3 - @react-navigation/material-bottom-tabs@5.0.0-alpha.3 - @react-navigation/material-top-tabs@5.0.0-alpha.3 - @react-navigation/native@5.0.0-alpha.2 - @react-navigation/routers@5.0.0-alpha.3 - @react-navigation/stack@5.0.0-alpha.4
@react-navigation/material-bottom-tabs
React Navigation integration for bottom navigation component from react-native-paper.
Installation
Open a Terminal in your project's folder and run,
yarn add @react-navigation/core @react-navigation/material-bottom-tabs
Setup react-native-paper following the Getting Started guide.
Usage
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
const MaterialBottomTabs = createMaterialBottomTabNavigator();
export default function App() {
return (
<MaterialBottomTabs.Navigator>
<MaterialBottomTabs.Screen
name="article"
component={Article}
options={{
tabBarLabel: 'Article',
tabBarIcon: 'chrome-reader-mode',
}}
/>
<MaterialBottomTabs.Screen
name="chat"
component={Chat}
options={{
tabBarLabel: 'Chat',
tabBarIcon: 'chat-bubble',
}}
/>
<MaterialBottomTabs.Screen
name="contacts"
component={Contacts}
options={{
tabBarLabel: 'Contacts',
tabBarIcon: 'contacts',
}}
/>
<MaterialBottomTabs.Screen
name="albums"
component={Albums}
options={{
tabBarLabel: 'Albums',
tabBarIcon: 'photo-album',
}}
/>
</MaterialBottomTabs.Navigator>
);
}