SwipeUI

Basic tab bar

A clean, standard tab bar with labels, badges and the safe-area inset, for Expo Router and React Navigation.

npx @swipeui/cli add tab-bar-basic
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When to use it

  • Apps with three to five top-level sections, such as Home, Search, Library and Profile, that need a familiar bottom bar.
  • Your first tab bar: it follows your theme and presets with no extra setup.
  • Products that need badges on tabs, like unread messages or new orders.
  • Apps that want an icon-only bar or labels only on the active tab, without changing components.

When not to use it

  • When you want the system's own tab bar, including Liquid Glass on iOS 26. Use Native tabs preset.
  • More than five destinations. Move the extras into a Profile or More screen instead of squeezing the bar.
  • Switching between views inside one screen. Use Segmented control or Top tabs.
  • A bar that floats or shrinks while scrolling. Floating pill or Minimize on scroll tab bar fit better.

Installation

Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.

npx @swipeui/cli add tab-bar-basic
  • Adds components/swipeui/tab-bar/tab-bar-basic.tsx and 10 shared helpers.
  • Installs clsx, tailwind-merge, react-native-reanimated, react-native-worklets, uniwind, expo-haptics, react-native-gesture-handler, class-variance-authority. In Expo apps it uses npx expo install so versions match your SDK.

Usage

app/(tabs)/_layout.tsx
import { Tabs } from 'expo-router/js-tabs';
import { TabBarBasic } from '@/components/swipeui/tab-bar/tab-bar-basic';

export default function TabLayout() {
  return (
    <Tabs tabBar={(props) => <TabBarBasic {...props} />} screenOptions={{ headerShown: false }}>
      <Tabs.Screen name="index" options={{ title: 'Home', tabBarIcon: HomeIcon }} />
      <Tabs.Screen name="profile" options={{ title: 'Profile', tabBarIcon: ProfileIcon }} />
    </Tabs>
  );
}

Labels, icons and badges come from each screen's options: tabBarLabel (or title), tabBarIcon, which receives the tab-active or tab-inactive colour, and tabBarBadge.

labelVisibility shows labels on every tab (always), only on the active tab (selected) or on none (never).

API reference

PropTypeDefaultDescription
motion?MotionOverridethe app feel

Local motion feel or spring override.

labelVisibility?TabBarLabelVisibility'always'

Which tabs show a label. Hidden labels are still read by screen readers.

divider?booleantrue

Draws the hairline along the top edge that separates the bar from scrolling content.

haptics?booleantrue

Plays a selection tick when the tab changes.

hideOnKeyboard?booleantrue

Hides the bar while the keyboard is open. A screen's tabBarHideOnKeyboard wins.

messages?TabBarMessages—

Replaces the built-in spoken wording, such as "Inbox, 3 new".

className?string—

Classes merged over the bar.

style?StyleProp<ViewStyle>—

Style escape hatch for the bar.

testID?string—

The bar gets testID; each tab ${testID}-${routeName} unless its screen sets tabBarButtonTestID.

Composition and behavior

  • Reads routes, icons, labels and badges from the navigator, so you configure each tab in screen options.
  • labelVisibility shows labels always, only on the selected tab, or never.
  • Icons are tinted with the tab-active and tab-inactive tokens; badges use the badge tokens.
  • Pads for the safe area and hides with the keyboard; set tabBarHideOnKeyboard per screen to opt out.
  • Works with Expo Router and React Navigation through the shared tab bar core.

Behavior and gestures

  • Tapping a tab switches to that section and plays a light selection tick.
  • Tapping the tab you're already on doesn't navigate again; it still sends tabPress, so screens that use useScrollToTop jump back to the top.
  • Long-pressing a tab sends tabLongPress, which you can use for shortcuts such as account switching.
  • Each tab gives a gentle press scale while your finger is down.
  • The bar hides while the keyboard is open so it never sits on top of a text field.
  • Badges appear on the icon as soon as a screen sets tabBarBadge.

Accessibility

  • The bar is a tab list and each tab reports whether it's selected.
  • Badges are read with the label: a count reads as "Inbox, 3 new", while text such as "New" is read as written.
  • Hidden labels (selected-only or icon-only) are still announced, so every tab has a name.
  • Tabs are at least 48 points tall and share the width, so every target is larger than 44 points.
  • Labels grow with Dynamic Type up to 1.4× and then stop, so the bar keeps a usable height.
  • It pads itself for the home indicator and Android's gesture bar.

Motion

  • Uses the press motion role, so it follows your app's feel. Pass motion to tune this one instance.
  • Press feedback uses the shared press spring; switching tabs has no sliding indicator.
  • Reduce Motion removes the press scale. The selection tick still plays unless haptics are off.

Performance

  • Renders a plain row; nothing animates while you scroll.
  • Only the pressed tab animates, on the UI thread.

Notes for AI

  • Pass it to the tabBar prop of Expo Router's Tabs or React Navigation's bottom tab navigator.
  • Set icons, labels and badges in each screen's options: tabBarIcon, title or tabBarLabel, and tabBarBadge.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
Expo RouterYes
React Navigation 7Yes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items