mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-28 12:25:21 +08:00
docs: update README
This commit is contained in:
@@ -1,5 +1,39 @@
|
||||
# React Navigation Tabs
|
||||
|
||||
Tab navigators for React Navigation.
|
||||
|
||||
## Installation
|
||||
|
||||
Open a Terminal in your project's folder and run,
|
||||
|
||||
```sh
|
||||
yarn add react-navigation-tabs react-navigation
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The package exports 3 different navigators:
|
||||
|
||||
- `createBottomTabNavigator`: iOS like bottom tabs.
|
||||
- `createMaterialBottomTabNavigator`: Material design themed animated bottom tabs, from [react-native-paper](https://callstack.github.io/react-native-paper/bottom-navigation.html).
|
||||
- `createMaterialTopTabNavigator`: Material design themed top tabs with swipe gesture, from [react-native-tab-view](https://github.com/react-native-community/react-native-tab-view).
|
||||
|
||||
You can import individual navigators and use them:
|
||||
|
||||
```js
|
||||
import createMaterialBottomTabNavigator from 'react-navigation-tabs/createMaterialBottomTabNavigator';
|
||||
|
||||
export default createMaterialBottomTabNavigator({
|
||||
Album: { screen: Album },
|
||||
Library: { screen: Library },
|
||||
History: { screen: History },
|
||||
Cart: { screen: Cart },
|
||||
}, {
|
||||
initialRouteName: 'Album',
|
||||
activeTintColor: '#F44336',
|
||||
});
|
||||
```
|
||||
|
||||
[![Build Status][build-badge]][build]
|
||||
[![Version][version-badge]][package]
|
||||
[![MIT License][license-badge]][license]
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
"react-native": "*",
|
||||
"react-navigation": "*"
|
||||
"react-navigation": "^2.0.0-alpha.5"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "react-native",
|
||||
|
||||
@@ -4231,7 +4231,7 @@ react-native-tab-view@^0.0.74:
|
||||
dependencies:
|
||||
prop-types "^15.6.0"
|
||||
|
||||
react-native-tab-view@^0.0.75:
|
||||
react-native-tab-view@~0.0.75:
|
||||
version "0.0.75"
|
||||
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.75.tgz#d71c24645ae1ce84a08152e212912f131906d0a4"
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user