# Tabs — React Native component for Expo

> Underline tabs whose indicator moves like liquid, leading edge first.

Underline tabs with swipeable content panes. The underline is measured to each label and moves like liquid — leading edge first, trailing edge catching up — and follows your finger while you drag the panes, with rubber-band resistance at the ends. Count badges pop, the bar scrolls and centres the active tab once tabs overflow, and every change ticks a haptic.

- Docs: https://expokit.in/docs/components/tabs
- Tier: Free
- Also called: tab view, top tabs, animated tabs
- Category: Navigation
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: expo-haptics
- Uses ExpoKit items: kit
- Variants: Underline, Profile, Scrollable, With Icons

## Installation

Run once per project: `npx @expokit/cli@latest init` (shared theme + KitProvider). Then:

```bash
npx @expokit/cli@latest add tabs
```

The CLI copies the source into your project (you own the code) and installs expo-haptics.

Import: `import { Tabs } from "@/components/ui/tabs";`

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` | `{ value, label, icon?, badge?, content?, disabled?, accessibilityLabel? }[]` | — | Tabs and (optionally) their content panes. `icon` is a node or `({ active, color }) => node`. |
| `value / defaultValue` | `string` | `first enabled tab` | Active tab (controlled / uncontrolled). |
| `onValueChange` | `(value: string) => void` | — | Called when a tab is pressed or swiped to. |
| `size` | `"sm" \| "md"` | `"md"` | 36 / 44pt tall (sm keeps a 44pt hit area). |
| `scrollable` | `boolean` | `auto` | `true` sizes tabs to labels and scrolls; `false` gives equal widths. Default fills the width and scrolls only when tabs overflow, keeping the active tab centred. |
| `swipeable` | `boolean` | `true` | Drag the content sideways to change tab; the underline tracks the drag. |
| `transition` | `"slide" \| "fade" \| "none"` | `"slide"` | How content changes on a tap. |
| `haptics` | `boolean` | `true` | Selection tick on change. |
| `accent` | `string` | `theme accent` | Underline and active badge colour. |
| `variant` | `"underline"` | `"underline"` | Deprecated: `pill` and `soft` render as `underline` — use SegmentedControl for a pill switch. |
| `contentStyle` | `StyleProp<ViewStyle>` | — | Style of each content pane. |
| `style` | `StyleProp<ViewStyle>` | — | Style for the root view wrapping the tab bar and content. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## Behaviour & accessibility

- **Touch**: Tap a tab or drag the content panes sideways; the underline follows your finger, with rubber-band resistance at the ends.
- **Motion**: The underline is measured to each label and springs with the leading edge first. Badges pop, and an overflowing bar scrolls to centre the active tab.
- **Reduced motion**: Springs become short timings, the bar scrolls without animating and badges change without the pop.
- **Haptics**: A selection tick on every change; turn it off with haptics={false}.
- **Screen readers**: The bar is a tablist of tabs with selected and disabled state; badges are read with the label, and inactive panes are hidden.

## FAQ

### How do I make a tab view in React Native?

Use ExpoKit's Tabs: run npx @expokit/cli@latest add tabs in your Expo or React Native project and it copies a ready-made tab view into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Tabs work in Expo Go?

Yes. Tabs runs in Expo Go on iOS and Android with no development build — its packages (expo-haptics) are all included in Expo Go.

### How do I add Tabs to my Expo app?

Run npx @expokit/cli@latest add tabs in your project. The CLI copies the component's source into your app and installs expo-haptics, so the code is yours to change.

### Is Tabs free?

Yes. Tabs is free: its full source is on this page and the CLI installs it without an account.

### Can I change how Tabs looks?

Yes. It takes its colours, radius and light / dark mode from useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.

## More

- Live preview, variants and code: https://expokit.in/docs/components/tabs
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
