react-navigation / react-navigation/react-navigation.github.io
Indicator not aligned with text in createMaterialTopTabNavigator
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 324
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to implement the top tab with scrollable tabs which are dynamic in number.
Following is my code:
<View style={{flex: 1}}>
{categories.length > 0 && (
<Tab.Navigator
lazy
tabBarOptions={{
labelStyle: {
fontSize: 13,
fontFamily: gothamMedium,
textTransform: 'none',
alignSelf: 'center',
textAlign: 'center',
},
indicatorStyle: {
backgroundColor: colors.AQUAMARINE,
height: 4,
},
activeTintColor: colors.GREYISH_BROWN,
inactiveTintColor: colors.WARM_GREY,
scrollEnabled: true,
}}>
{categories.map(category => (
<Tab.Screen
options={{
title: category.title,
}}
name={category.title}
component={() => <TabList tabData={category} />}
/>
))}
</Tab.Navigator>
)} </View>
Which works fine for the first tab:

And here is how second tab looks like:
And it gets worse scrolled to 3rd and beyond
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported indicator alignment problem with createMaterialTopTabNavigator, using the dynamic categories and Tab.Navigator configuration shown in the issue. Compare the first, second, and later scrollable tabs, and consider the issue complete when the indicator aligns consistently with each tab's text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100