Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Material Bottom Tabs Border radius

I just want to find a way to transform my material bottom tabs just like this

Is there a way to do something like this?

enter image description here

I cant' apply a border radius to it using the barStyle

    <Tab.Navigator
    initialRouteName="Home"
    activeColor={Colors.primary}
    inactiveColor="black"
    barStyle={{ backgroundColor: 'white', borderRadius: 30}}
    >
like image 464
Astral Cloud Avatar asked May 18 '26 19:05

Astral Cloud


2 Answers

You need to have a overflow:'hidden' along with a position:'absolute'

    barStyle={{
      backgroundColor: 'white',
      position: 'absolute',
      overflow: 'hidden',
      borderTopLeftRadius: 30,
      borderTopRightRadius: 30,
    }}>
like image 185
Guruparan Giritharan Avatar answered May 24 '26 07:05

Guruparan Giritharan


This might help :

Saw it from cehck this

<NavigationContainer>
      <Tab.Navigator 
  barStyle={{ borderWidth: 0.5,
            borderBottomWidth: 1,
            backgroundColor:'orange',
            borderTopLeftRadius: 15,
            borderTopRightRadius: 15,
            borderColor: 'transparent',
            overflow: 'hidden', }}

      >
        <Tab.Screen name="Home" component={HomeScreen} />
        <Tab.Screen name="Settings" component={SettingsScreen} />
      </Tab.Navigator>
    </NavigationContainer>

Hope it helps. feel free for doubts

like image 27
Gaurav Roy Avatar answered May 24 '26 08:05

Gaurav Roy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!