← Back to archive

Repo of the Day

ninadsutrave/react-native-shrinking-tab-bar

Published: Nov 28, 2026

Open repository ↗

Floating pill tab bar for React Navigation and Expo Router that shrinks to icons on scroll. Transform-only animations, glass, RTL

Summary

react-native-shrinking-tab-bar is a TypeScript package that provides a floating pill tab bar for React Navigation 7 and Expo Router. It collapses to icons while a screen scrolls down, expands on upward scroll or tab changes, and can optionally hide completely while supporting custom styling, glass backgrounds, RTL, badges, and accessibility.

What it is useful for

The component is useful for mobile apps whose main screens contain long, scrollable content, such as feeds, dashboards, and messaging interfaces. It preserves the tab options already defined by the navigator, including icons, labels, badges, tint colors, test IDs, and accessibility labels.

Engineers can choose whether scrolling shrinks the bar to icons or slides it away. Other options include scroll thresholds, animation configuration, indicators, colors, sizing, placement, press feedback, shadows, and a round action button beside the bar. Presets cover compact layouts, full-width bars, minimal styling, and hide-on-scroll behavior.

The built-in animation uses transforms and opacity on the UI thread. The README notes two exceptions: custom backgrounds and custom indicators require a changing clipping box, which adds one layout pass per animation frame. Web is untested, and older supported versions are described as expected to work rather than tested. Short screens also cannot collapse because they have no meaningful scroll range.

How engineers can use it

Install the package and its peer dependencies:

npm install react-native-shrinking-tab-bar
npm install react-native-reanimated react-native-safe-area-context

With React Navigation, pass the component as the navigator’s tabBar:

<Tab.Navigator tabBar={(props) => <ShrinkingTabBar {...props} />}>
  <Tab.Screen name="Home" component={Home} />
</Tab.Navigator>

For Expo Router, use the same pattern in app/(tabs)/_layout.tsx:

<Tabs tabBar={(props) => <ShrinkingTabBar {...props} />} />

Connect each scrollable screen to the bar using useShrinkingTabBarScrollHandler(), and add useShrinkingTabBarInset() as bottom padding so the final list item remains visible. For lists that are not Reanimated components, such as FlashList or SectionList, use useShrinkingTabBarScrollListener() instead.

An optional glass background requires the documented Expo packages:

npx expo install expo-glass-effect expo-blur

On Expo Go, enable RTL with "extra": { "supportsRTL": true } in app.json. If setup or behavior does not match the README, consult its troubleshooting section, which covers missing scroll handlers, hidden list items, Android blur fallbacks, and nested tab bars requiring separate providers.