tabBarAccessibilityLabel | | Accessibility label for the tab button. This is read by the screen reader when the user taps the tab. It's recommended to set this if you don't have a label for the tab. |
tabBarActiveBackgroundColor | | Background color for the active tab. |
tabBarActiveTintColor | | Color for the icon and label in the active tab. |
tabBarBackground | | Function which returns a React Element to use as background for the tab bar. You could render an image, a gradient, blur view etc.:
import { BlurView } from 'expo-blur';
import { StyleSheet } from 'react-native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
createBottomTabNavigator({
screenOptions: {
tabBarStyle: { position: 'absolute' },
tabBarBackground: () => (
<BlurView tint="light" intensity={100} style={StyleSheet.absoluteFill} />
),
},
screens: {
},
});
import { BlurView } from 'expo-blur';
import { StyleSheet } from 'react-native';
<Tab.Navigator
screenOptions={{
tabBarStyle: { position: 'absolute' },
tabBarBackground: () => (
<BlurView tint="light" intensity={100} style={StyleSheet.absoluteFill} />
),
}}
>
When using BlurView, make sure to set position: 'absolute' in tabBarStyle as well. You'd also need to use useBottomTabBarHeight to add bottom padding to your content. |
tabBarBadge | | Text to show in a badge on the tab icon. Accepts a string or a number. |
tabBarBadgeStyle | | Style for the badge on the tab icon. You can specify a background color or text color here. |
tabBarButton | | Function which returns a React element to render as the tab bar button. It wraps the icon and label. Renders PlatformPressable by default.
You can specify a custom implementation here:
tabBarButton: (props) => <TouchableOpacity {...props} />;
|
tabBarButtonTestID | | ID to locate this tab button in tests. |
tabBarHideOnKeyboard | | Whether the tab bar is hidden when the keyboard opens. Defaults to false. |
tabBarIcon | | Function that given { focused: boolean, color: string, size: number } returns a React.Node, to display in the tab bar. |
tabBarIconStyle | | Style object for the tab icon. |
tabBarInactiveBackgroundColor | | Background color for the inactive tabs. |
tabBarInactiveTintColor | | Color for the icon and label in the inactive tabs. |
tabBarItemStyle | | Style object for the tab item container. |
tabBarLabel | | Title string of a tab displayed in the tab bar or a function that given { focused: boolean, color: string } returns a React.Node, to display in tab bar. When undefined, scene title is used. To hide, see tabBarShowLabel. |
tabBarLabelPosition | | Whether the label is shown below the icon or beside the icon. By default, the position is chosen automatically based on device width.
-
below-icon
The label is shown below the icon (typical for devices with smaller widths such as phones)
-
beside-icon
The label is shown next to the icon (typical for larger devices such as tablets)
|
tabBarLabelStyle | | Style object for the tab label. |
tabBarPosition | | Position of the tab bar. Available values are:
bottom (Default)
top
left
right
When the tab bar is positioned on the left or right, it is styled as a sidebar. This can be useful when you want to show a sidebar on larger screens and a bottom tab bar on smaller screens:
You can also render a compact sidebar by placing the label below the icon. This is only supported when the tabBarVariant is set to material: |
tabBarShowLabel | | Whether the tab label should be visible. Defaults to true. |
tabBarStyle | | Style object for the tab bar. You can configure styles such as background color here.
To show your screen under the tab bar, you can set the position style to absolute:
createBottomTabNavigator({
screenOptions: {
tabBarStyle: { position: 'absolute' },
},
screens: {
},
});
<Tab.Navigator
screenOptions={{
tabBarStyle: { position: 'absolute' },
}}
>
You also might need to add a bottom margin to your content if you have an absolutely positioned tab bar. React Navigation won't do it automatically. See useBottomTabBarHeight for more details. |
tabBarVariant | | Variant of the tab bar. Available values are:
uikit (Default) - The tab bar will be styled according to the iOS UIKit guidelines.
material - The tab bar will be styled according to the Material Design guidelines.
The material variant is currently only supported when the tabBarPosition is set to left or right. |