Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ability to override bottom tab sideContent and bottomContent styles #11927

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/bottom-tabs/src/types.tsx
Expand Up @@ -227,6 +227,11 @@ export type BottomTabNavigationOptions = HeaderOptions & {
*/
tabBarStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;

/**
* Style object for the tab bar content container.
*/
tabBarContentStyle?: StyleProp<ViewStyle>;

/**
* Function which returns a React Element to use as background for the tab bar.
* You could render an image, a gradient, blur view etc.
Expand Down
6 changes: 5 additions & 1 deletion packages/bottom-tabs/src/views/BottomTabBar.tsx
Expand Up @@ -155,6 +155,7 @@ export function BottomTabBar({
tabBarHideOnKeyboard = false,
tabBarVisibilityAnimationConfig,
tabBarStyle,
tabBarContentStyle,
tabBarBackground,
tabBarActiveTintColor,
tabBarInactiveTintColor,
Expand Down Expand Up @@ -332,7 +333,10 @@ export function BottomTabBar({
</View>
<View
accessibilityRole="tablist"
style={tabBarIsHorizontal ? styles.bottomContent : styles.sideContent}
style={[
tabBarIsHorizontal ? styles.bottomContent : styles.sideContent,
tabBarContentStyle,
]}
>
{routes.map((route, index) => {
const focused = index === state.index;
Expand Down