You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/navigators/TabNavigator.md
+36-35Lines changed: 36 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,33 +81,34 @@ The route configs object is a mapping from route name to a route config, which t
81
81
82
82
### TabNavigatorConfig
83
83
84
-
-`tabBarComponent` - component to use as the tab bar, e.g. `TabBarBottom`
84
+
-`tabBarComponent` - Component to use as the tab bar, e.g. `TabBarBottom`
85
85
(this is the default on iOS), `TabBarTop`
86
-
(this is the default on Android)
87
-
-`tabBarPosition` - position of the tab bar, can be `'top'` or `'bottom'`
88
-
-`swipeEnabled` - whether to allow swiping between tabs
89
-
-`animationEnabled` - whether to animate when changing tabs
90
-
-`lazy` - whether to lazily render tabs as needed as opposed to rendering them upfront
91
-
-`tabBarOptions` - configure the tab bar, see below.
86
+
(this is the default on Android).
87
+
-`tabBarPosition` - Position of the tab bar, can be `'top'` or `'bottom'`.
88
+
-`swipeEnabled` - Whether to allow swiping between tabs.
89
+
-`animationEnabled` - Whether to animate when changing tabs.
90
+
-`lazy` - Whether to lazily render tabs as needed as opposed to rendering them upfront.
91
+
-`initialLayout` - Optional object containing the initial `height` and `width`, can be passed to prevent the one frame delay in [react-native-tab-view](https://github.com/react-native-community/react-native-tab-view#avoid-one-frame-delay) rendering.
92
+
-`tabBarOptions` - Configure the tab bar, see below.
92
93
93
94
Several options get passed to the underlying router to modify navigation logic:
94
95
95
-
-`initialRouteName` - The routeName for the initial tab route when first loading
96
-
-`order` - Array of routeNames which defines the order of the tabs
96
+
-`initialRouteName` - The routeName for the initial tab route when first loading.
97
+
-`order` - Array of routeNames which defines the order of the tabs.
97
98
-`paths` - Provide a mapping of routeName to path config, which overrides the paths set in the routeConfigs.
98
99
-`backBehavior` - Should the back button cause a tab switch to the initial tab? If yes, set to `initialRoute`, otherwise `none`. Defaults to `initialRoute` behavior.
99
100
100
101
### `tabBarOptions` for `TabBarBottom` (default tab bar on iOS)
101
102
102
-
-`activeTintColor` - label and icon color of the active tab
103
-
-`activeBackgroundColor` - background color of the active tab
104
-
-`inactiveTintColor` - label and icon color of the inactive tab
105
-
-`inactiveBackgroundColor` - background color of the inactive tab
106
-
-`showLabel` - whether to show label for tab, default is true
107
-
-`style` - style object for the tab bar
108
-
-`labelStyle` - style object for the tab label
109
-
-`tabStyle` - style object for the tab
110
-
-`allowFontScaling` - whether label font should scale to respect Text Size accessibility settings, default is true
103
+
-`activeTintColor` - Label and icon color of the active tab.
104
+
-`activeBackgroundColor` - Background color of the active tab.
105
+
-`inactiveTintColor` - Label and icon color of the inactive tab.
106
+
-`inactiveBackgroundColor` - Background color of the inactive tab.
107
+
-`showLabel` - Whether to show label for tab, default is true.
108
+
-`style` - Style object for the tab bar.
109
+
-`labelStyle` - Style object for the tab label.
110
+
-`tabStyle` - Style object for the tab.
111
+
-`allowFontScaling` - Whether label font should scale to respect Text Size accessibility settings, default is true.
111
112
112
113
Example:
113
114
@@ -125,20 +126,20 @@ tabBarOptions: {
125
126
126
127
### `tabBarOptions` for `TabBarTop` (default tab bar on Android)
127
128
128
-
-`activeTintColor` - label and icon color of the active tab
129
-
-`inactiveTintColor` - label and icon color of the inactive tab
130
-
-`showIcon` - whether to show icon for tab, default is false
131
-
-`showLabel` - whether to show label for tab, default is true
132
-
-`upperCaseLabel` - whether to make label uppercase, default is true
133
-
-`pressColor` - color for material ripple (Android >= 5.0 only)
134
-
-`pressOpacity` - opacity for pressed tab (iOS and Android < 5.0 only)
135
-
-`scrollEnabled` - whether to enable scrollable tabs
136
-
-`tabStyle` - style object for the tab
137
-
-`indicatorStyle` - style object for the tab indicator (line at the bottom of the tab)
138
-
-`labelStyle` - style object for the tab label
139
-
-`iconStyle` - style object for the tab icon
140
-
-`style` - style object for the tab bar
141
-
-`allowFontScaling` - whether label font should scale to respect Text Size accessibility settings, default is true
129
+
-`activeTintColor` - Label and icon color of the active tab.
130
+
-`inactiveTintColor` - Label and icon color of the inactive tab.
131
+
-`showIcon` - Whether to show icon for tab, default is false.
132
+
-`showLabel` - Whether to show label for tab, default is true.
133
+
-`upperCaseLabel` - Whether to make label uppercase, default is true.
134
+
-`pressColor` - Color for material ripple (Android >= 5.0 only).
135
+
-`pressOpacity` - Opacity for pressed tab (iOS and Android < 5.0 only).
136
+
-`scrollEnabled` - Whether to enable scrollable tabs.
137
+
-`tabStyle` - Style object for the tab.
138
+
-`indicatorStyle` - Style object for the tab indicator (line at the bottom of the tab).
139
+
-`labelStyle` - Style object for the tab label.
140
+
-`iconStyle` - Style object for the tab icon.
141
+
-`style` - Style object for the tab bar.
142
+
-`allowFontScaling` - Whether label font should scale to respect Text Size accessibility settings, default is true.
142
143
143
144
Example:
144
145
@@ -160,15 +161,15 @@ tabBarOptions: {
160
161
161
162
#### `title`
162
163
163
-
Generic title that can be used as a fallback for `headerTitle` and `tabBarLabel`
164
+
Generic title that can be used as a fallback for `headerTitle` and `tabBarLabel`.
164
165
165
166
#### `tabBarVisible`
166
167
167
-
True or false to show or hide the tab bar, if not set then defaults to true
168
+
True or false to show or hide the tab bar, if not set then defaults to true.
168
169
169
170
#### `tabBarIcon`
170
171
171
-
React Element or a function that given `{ focused: boolean, tintColor: string }` returns a React.Element, to display in tab bar
172
+
React Element or a function that given `{ focused: boolean, tintColor: string }` returns a React.Element, to display in tab bar.
0 commit comments