Tab bars
How SwipeUI tab bars plug into Expo Router and React Navigation, and the free core every bar is built on.
Every SwipeUI tab bar is a custom tabBar for Expo Router's Tabs and React Navigation's bottom tabs. Pass it the navigator's props and keep your screens, icons and badges as they are:
<Tabs tabBar={(props) => <TabBarBasic {...props} />} />
// React Navigation
<Tab.Navigator tabBar={(props) => <TabBarBasic {...props} />} />Import Tabs from expo-router/js-tabs (importing it from expo-router is deprecated in SDK 57 and 58).
The bars
- Action morph menuProThe quick-action menu that a drop spits out of a button and blooms into Liquid Glass, with the button that opens it, rows with progress and retry, and the hook that runs them.
- Native tabs actionProA round action beside Expo Router's native tab bar, drawn by the system in Liquid Glass, that opens a sheet of quick actions or the action-morph glass menu.
- Native tabs presetFreeSwipeUI's tint, label and badge tokens and a matched SF Symbol and Material Symbol icon set for Expo Router's native tabs.
- Quick actionsFreeQuick-action rows, the runner behind them and a bottom sheet of them: one action at a time, progress in its row, a retry in place after a failure, shared by menus and sheets.
- TabBarActionMorphProA floating bar whose centre action is stretched into a peak that spits a drop out, which blooms into a small Liquid Glass menu; closing lets it fall back in.
- Basic tab barFreeA clean, standard tab bar with labels, badges and the safe-area inset, for Expo Router and React Navigation.
- TabBarGlassActionProA Liquid Glass capsule of tabs with a draggable glass lens, and a round glass action as tall as the capsule.
- TabBarNotchProA tab bar with a notch cut into its top edge, docked or floating: it cradles a circle, square or diamond centre action, or carries the selected tab up into a bubble that follows the selection.
- Top tabsFreeTabs for sections inside a screen: a label strip with icons, badges and an underline or pill indicator, over swipeable pages.
What every bar does
- Reads your screen options:
tabBarLabel(ortitle, or the route name),tabBarIcon,tabBarBadge,tabBarAccessibilityLabel,tabBarButtonTestIDandtabBarShowLabel. Icons receive thetab-activeortab-inactivecolour. - Behaves like the built-in bars: a press emits
tabPress(listeners can prevent it), then switches tab; a long press emitstabLongPress. - Hides when it should: while the keyboard is open (a screen's
tabBarHideOnKeyboard: falsekeeps it), and when the focused screen setstabBarStyle: { display: 'none' }. - Pads for the device: the navigator's safe-area insets, so the home indicator and Android's gesture bar never cover a tab.
- Accessible: a tab list of tabs with selected states, badges read with the label ("Inbox, 3 new"), 44pt targets and labels capped at 1.4× Dynamic Type.
- Haptics: a selection tick when the tab changes, never on reselecting. Pass
haptics={false}to turn it off.
Building your own bar
tab-bar-core is the free, headless model behind every bar. It's installed with any bar, or on its own:
npx @swipeui/cli add tab-bar-coreimport { Pressable, Text, View } from 'react-native';
import { useTabBar } from '@/components/swipeui/tab-bar/use-tab-bar';
import type { TabBarProps } from '@/components/swipeui/tab-bar/use-tab-bar';
export function MyTabBar(props: TabBarProps) {
const { items, hidden, insets, containerProps } = useTabBar(props);
if (hidden) return null;
return (
<View {...containerProps} className="flex-row bg-surface" style={{ paddingBottom: insets.bottom }}>
{items.map((item) => (
<Pressable key={item.key} {...item.accessibility} onPress={item.onPress} className="flex-1 items-center p-2">
<Text className={item.isFocused ? 'text-tab-active' : 'text-tab-inactive'}>{item.label}</Text>
</Pressable>
))}
</View>
);
}TabBarProps accepts both navigators' props: Expo Router 58 passes emitter and navigateToTab, React Navigation 7 passes navigation, and the hook handles either.
| Prop | Type | Default | Description |
|---|---|---|---|
| No props of its own. | |||
Minimise on scroll
TabBarScrollProvider shares scroll position between screens and a bar. Wrap the navigator, give each scrolling screen useTabBarScrollHandler(), and read useTabBarMinimizeProgress() (0 expanded, 1 minimised) in a bar. Everything runs on the UI thread, and Reduce Motion makes the change instant. The bottom accessory uses it to shrink on custom bars; native tabs minimise on their own.
Icons with badges
tab-bar-icon draws a tab's icon with its badge at the top-end corner, counts above 99 shown as "99+". Every SwipeUI bar uses it.