Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Custom component above native tabbar #366

dylancom started this conversation in Ideas
Discussion options

Is it possible to render a custom component above the native (iOS) tabbar?
For e.g. an Audio Player that stays fixed on top of the tabbar as you see in may Music Player applications.
Or an Adaptive Banner ad that sits on top.

This works with a custom tabbar:

tabBar={(props) => (
 <>
 <Player />
 <BottomTabBar {...props} />
 </>
)}

But I'd like to keep the native tabbar instead of a JS implementation.

Examples:
image

image

You must be logged in to vote

Replies: 5 comments 4 replies

Comment options

Hey, you can achieve this by putting the component on per screen basis (or doing some kind of HOC that would place it there) and use the useBottomTabBarHeight() hook to offset this "accessory view" from the bottom

You must be logged in to vote
1 reply
Comment options

Thanks for your reply. This is not ideal as this would render in case of an anchored banner ad a new banner per screen.

Comment options

maybe you can set screens height to be Dimensions.height - bottom tab height; component below bottom tab, but with a translateY of the bottom tab height so it's always above it

I happen to have the exact UI need (music app musicplayer) and my approach is a screen nav without bottom tabs, and a bottom tab nav with only the bottom tabs, then the component sandwiched between them. its a bit more costly but easier to manage layouts

You must be logged in to vote
0 replies
Comment options

I saw this in the iOS 26 videos with the .tabViewBottomAccessory modifier.

image
You must be logged in to vote
1 reply
Comment options

I was able to get a react native view passed into the tabViewBottomAccessory spot, but I couldn't consistently get the tabViewBottomAccessoryPlacement variable over. Might be a memoization issue in my implementation, it fires decently using an onChange(of:) modifier in SwiftUI

Comment options

anyone working on this? @hennessyevan did you manage to implement this? Otherwise I would like to give it a go

You must be logged in to vote
2 replies
Comment options

I switched to the react-native-screens implementation since that's what expo-router uses now. They're also working on this so I'm just waiting to see.

Comment options

Comment options

I was able to add support for tabViewBottomAccessory in this PR #446

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /