Skip to main content
Version: 0.5.0

TabBar

The built-in tab bar component. Can be used directly when providing a custom renderTabBar implementation.

import { TabBar } from 'reanimated-tab-view';

Props

TabBar extends ScrollViewProps (excluding children and indicatorStyle) and accepts:

PropTypeDefaultDescription
activeColorstringundefinedColor of the active tab label.
inactiveColorstringundefinedColor of inactive tab labels.
getLabelText(scene: Scene) => string | undefinedundefinedCustom function to get label text for a tab.
renderTabContent(props: TabContentProps & { route: Route }) => ReactNodeundefinedCustom renderer for individual tab content.
onTabPress(scene: Scene) => voidundefinedCallback when a tab is pressed.
onTabLongPress(scene: Scene) => voidundefinedCallback when a tab is long-pressed.
tabContentStyleStyleProp<ViewStyle>undefinedStyle for tab content wrapper.
indicatorStyleStyleProp<ViewStyle>undefinedStyle for the tab indicator.
labelStyleStyleProp<TextStyle>undefinedStyle for tab labels.
tabStyleStyleProp<ViewStyle>undefinedStyle for individual tabs.

Usage with renderTabBar

<TabView
tabBarConfig={{
renderTabBar: (props) => (
<TabBar
{...props}
activeColor="#6200ee"
inactiveColor="#666"
indicatorStyle={{ backgroundColor: '#6200ee' }}
/>
),
}}
/>

Custom label text

<TabBar
{...props}
getLabelText={({ route }) => route.title?.toUpperCase()}
/>