Skip to content

Commit

Permalink
feat: expose tabBarGap option in material top tabs (#11038)
Browse files Browse the repository at this point in the history
the new `tabBarGap` option helps to configure `gap` option of `react-native-tab-view` : see https://github.com/react-navigation/react-navigation/tree/main/packages/react-native-tab-view#gap
  • Loading branch information
mlecoq committed Nov 28, 2022
1 parent 61ffc24 commit 29818a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/material-top-tabs/src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ export type MaterialTopTabNavigationOptions = {
*/
tabBarStyle?: StyleProp<ViewStyle>;

/**
* Gap between tabs
*/
tabBarGap?: number;

/**
* Whether to enable swipe gestures when this screen is focused.
* Swipe gestures are enabled by default. Passing `false` will disable swipe gestures,
Expand Down
1 change: 1 addition & 0 deletions packages/material-top-tabs/src/views/MaterialTopTabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default function TabBarTop({
{ backgroundColor: colors.primary },
focusedOptions.tabBarIndicatorStyle,
]}
gap={focusedOptions.tabBarGap}
indicatorContainerStyle={focusedOptions.tabBarIndicatorContainerStyle}
contentContainerStyle={focusedOptions.tabBarContentContainerStyle}
style={[{ backgroundColor: colors.card }, focusedOptions.tabBarStyle]}
Expand Down

0 comments on commit 29818a8

Please sign in to comment.