Custom Bottom bar for iOS and Android#8307
Open
markdevocht wants to merge 15 commits into
Open
Conversation
…-native-navigation into feat/Custom-bottom-bar-buttons
|
Thanks a lot, Mark, for such an initiative and great work you are doing recently. Much appreciated and highly needed. ❤️🙏🏻 A few questions, confirmations, and brainstorming ideas:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds custom bottom tab items: render a registered React component per tab instead of native icon + label, with optional floating row chrome via
bottomTabs.customRow. Same JavaScript API on iOS and Android.Native
BottomTabs/UITabBarstill owns selection and layout state. Visible bar chrome is hidden; a floating custom row hosts one React surface per tab in equal-width slots.Motivation
Apps need tab bars with Lottie/SVG icons, custom badges, and fully custom chrome without reimplementing tab selection, stack switching,
popToRoot, hardware back history, or navigation events.API
bottomTab.component(required on every tab)Props delivered to the tab item component:
componentId,tabIndex,selected,badge(updated when selection or badge changes).passPropsfrombottomTab.component.passPropsare merged at creation time only; usetabIndexinside the component for per-tab UI.If only some tabs set
component, RNN logs a warning and falls back to native rendering for all tabs in that bar.Per-tab visual options ignored when
componentis set:text,icon,selectedIcon, SF symbols, icon/text colors and sizes, etc. Native still handles selection, visibility,drawBehind, animations, anddotIndicator.bottomTabs.customRow(optional)heightbackgroundColorbackgroundEffectbackgroundEffect'glass'|'blur'|'none'cornerRadiushorizontalMarginbottomMarginApplies on
setRoot,showModal,mergeOptions, andsetDefaultOptions.Events
registerBottomTabPressedListenerregisterBottomTabSelectedListenerregisterBottomTabLongPressedListenerUITabBarlong press (hidden for custom tabs)selectTabOnPress: false,popToRoot, and Android hardware-back tab history behave the same as with native bottom tabs.Implementation
iOS
RNNBottomTabsCustomRow— hosts React tab cells, appliescustomRow, layout and tapsRNNBottomTabsController— hides native bar visuals, attaches custom row, routes taps through existing selection/event pathtabBarMinimizeBehaviorforced toneverwhen custom items are activeAndroid
com.reactnativenavigation.customrowpackage (BottomTabsCustomRow, attacher, layout, module, config store)BottomTabs.setExternalCustomItemViewHost(true)— custom row owns React item viewsAndroidCustomRowForwarder— forwardscustomRowfrom navigation commands before layoutBottomTabsbottom; avoids double-counting nav insets and layout idle loopsJS
Options.ts—bottomTab.component,bottomTabs.customRowCommands.ts— Android custom-row forwarding on relevant commandsPlayground
Layouts → BottomTabs Custom Component — modal with glass custom row and shared
CustomBottomTabItem(RN primitive icons, badge on Search tab).Key files:
playground/src/screens/LayoutsScreen.tsx—bottomTabsWithCustomComponentplayground/src/screens/CustomBottomTabItem.tsxplayground/src/screens/CustomBottomTabContentScreen.tsxDocumentation
website/docs/docs/docs-customBottomTabs.mdx(basic example, tab item example,customRow, events, platform notes)options-bottomTab.mdx(component),options-bottomTabs.mdx(customRow)registerBottomTabPressedListenerdocumented; custom-tab event parity notedTest plan
playground/e2e/CustomBottomTabComponent.test.js— 7 tests (render, badge, tab switching)android.emu.release) — 7/7 passios.sim.release) — 7/7 passbottomTab.component)Notes for reviewers
AHBottomNavigation) — same as native bottom tabsbackgroundEffect: 'glass'uses material chrome (no system glass API); iOS 26+ usesUIGlassEffectwhere available