Skip to main content
Version: 0.5.0

Custom Tab Bar

Reanimated Tab View provides multiple ways to customize the tab bar appearance or replace it entirely.

Styling the built-in tab bar

Use properties in tabBarConfig to style the default tab bar:

<TabView
tabBarConfig={{
tabBarStyle: { backgroundColor: '#fff' },
tabStyle: { paddingHorizontal: 16 },
tabBarIndicatorStyle: { backgroundColor: '#6200ee', height: 3 },
tabLabelStyle: { fontSize: 14, fontWeight: '600' },
}}
// ...other props
/>

Tab bar colors

Control active and inactive tab colors via the TabBarProps:

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

Tab bar position

Place the tab bar at the top or bottom:

<TabView
tabBarConfig={{
tabBarPosition: 'bottom',
}}
/>

Custom tab bar component

For full control, use renderTabBar in tabBarConfig:

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

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

Custom tab content

To customize how individual tab labels are rendered, use renderTabContent:

<TabView
tabBarConfig={{
renderTabBar: (props) => (
<TabBar
{...props}
renderTabContent={({ route, activePercentage, label }) => {
// Return your custom tab content
return (
<View style={styles.tab}>
<Icon name={route.key} />
<Text>{label}</Text>
</View>
);
}}
/>
),
}}
/>

The renderTabContent callback receives TabContentProps along with the route:

PropTypeDescription
activePercentageSharedValue<number>Animated value from 0 (inactive) to 1 (active)
labelstring | undefinedThe tab label text
activeColorstring | undefinedColor when active
inactiveColorstring | undefinedColor when inactive
labelStyleStyleProp<TextStyle>Label text style
routeRouteThe route object for this tab

Tab events

Handle tab press and long press events:

<TabView
tabBarConfig={{
renderTabBar: (props) => (
<TabBar
{...props}
onTabPress={({ route }) => {
console.log('Pressed tab:', route.key);
}}
onTabLongPress={({ route }) => {
console.log('Long pressed tab:', route.key);
}}
/>
),
}}
/>