Expo App UIExpo App UI
Components

Tabs

Three tab styles (underline, pills, segmented) with animated indicator and scrollable variant.

Installation

npx expo-app-ui add tabs

Usage

import Tabs from "@/components/ui/tabs";
import { useState } from "react";

const [tab, setTab] = useState<"all" | "unread" | "archived">("all");

<Tabs
  value={tab}
  onChange={setTab}
  items={[
    { key: "all",      label: "All" },
    { key: "unread",   label: "Unread" },
    { key: "archived", label: "Archived" },
  ]}
  variant="underline"
/>

Props

PropTypeDefaultDescription
itemsTabItem<T>[]requiredTabs to render
valueTrequiredSelected key
onChange(key: T) => voidrequiredChange handler
variant'underline' | 'pills' | 'segmented''underline'Visual style
scrollablebooleanfalseHorizontal scroll
activeColorstring'#2563EB'Active label / indicator color
inactiveColorstring'#6B7280'Inactive label color
pillBackgroundstring'#F3F4F6'Background for segmented

TabItem: { key: T; label: string; disabled?: boolean }.

Accessibility

  • Container: accessibilityRole="tablist"
  • Each tab: accessibilityRole="tab" with accessibilityState.selected

On this page

Find this useful?

Buy me a coffee