Tabs
Controlled Tab, TabBar, TabNavigation, and TabScreen primitives for explicit tab selection and optional swipe navigation.
ARCUI's Tabs API contains four public primitives:
Usage
Tab
TabBar
TabNavigation
TabScreenSelection is always controlled through activeTab.
TabBar
Use TabBar directly when the application already owns page rendering.
const [activeTab, setActiveTab] = useState("overview");
<TabBar activeTab={activeTab} onActiveTabChange={setActiveTab}>
<Tab value="overview" label="Overview" />
<Tab value="activity" label="Activity" />
</TabBar>;The parent decides which content corresponds to the active value.
Tab content
A Tab can be:
- text-only;
- icon + text;
- icon-only.
<Tab value="home" label="Home" />
<Tab value="search" label="Search" icon="search" />
<Tab value="info" icon="info" accessibilityLabel="Information" />Icon-only tabs require an explicit accessible name.
iconPosition is "start" or "top" when both label and icon are present.
accessibilityHint is optional application-specific extra guidance.
Badge
Tabs support a compact dot badge:
<Tab
value="inbox"
label="Inbox"
badge={{ variant: "dot" }}
/>badge.color can provide a fixed dot color.
TabBar presentations
solid | border | text | underline | segmentDefaults:
type = underline
orientation = horizontal
sizeMode = fillsizeMode="content" sizes the bar to content instead of filling its available axis.
segmentInset affects only type="segment" and otherwise has no segment-indicator effect.
Tab values and controlled fallback
Every rendered Tab value must be a non-empty unique string. Empty or duplicate values are identity invariants and fail clearly.
If a controlled activeTab temporarily does not exist in the rendered children, TabBar reports a development diagnostic and visually falls back to the first available tab. The consumer remains the semantic state owner and should reconcile activeTab to a rendered value.
TabNavigation
TabNavigation derives its controls from direct TabScreen children.
const [activeTab, setActiveTab] = useState("account");
<TabNavigation
activeTab={activeTab}
onActiveTabChange={setActiveTab}
>
<TabScreen value="account" label="Account">
<AccountScreen />
</TabScreen>
<TabScreen value="security" label="Security">
<SecurityScreen />
</TabScreen>
</TabNavigation>;Do not place Tab directly inside TabNavigation; use direct TabScreen children.
TabScreen values follow the same non-empty/unique identity requirement. An invalid controlled activeTab follows the same first-screen visual fallback behavior with a development diagnostic.
Swipe navigation
swipeEnabled defaults to true.
Swipe gestures move pager visuals through Reanimated while activeTab remains the semantic source of truth. A swipe requests a new controlled tab value; the owner still decides whether to commit it.
TabBar position and layout
tabBarPosition:
top | bottom | start | endDefault: top.
tabBarLayout:
inline -> TabBar participates in layout
overlay -> page content occupies full bounds and bar floats above itDefault: inline.
Overlay mode intentionally does not add automatic page padding.
TabBar surface customization
<TabNavigation
activeTab={activeTab}
onActiveTabChange={setActiveTab}
tabBarRadius={16}
tabBarSizeMode="content"
tabBarAlignment="center"
tabBarInset={12}
>
{/* direct TabScreen children */}
</TabNavigation>Background priority:
tabBarBackgroundColor
-> complete tabBarDarkBackgroundColor + tabBarLightBackgroundColor pair
-> Tabs tokenstabBarAlignment affects content-sized bars; while size mode is fill, it has no visible main-axis alignment effect.
Testing
Use testID where the public component contract exposes it so application tests can target the ARCUI-owned root without depending on visual implementation details. Component-specific stable descendants may use documented suffixes.
For provider setup and the dedicated react-native-arc-ui/testing entrypoint, see Testing.
API Reference
ITab
Tab Text Content
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | required | — |
| badge? | TTabBadge | — | — |
| testID? | string | — | — |
| accessibilityHint? | string | — | Optional additional accessibility guidance. ARCUI does not provide generic screen-reader gesture instructions. |
| label | string | required | — |
| accessibilityLabel? | string | — | — |
Tab Icon Text Content
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | required | — |
| badge? | TTabBadge | — | — |
| testID? | string | — | — |
| accessibilityHint? | string | — | Optional additional accessibility guidance. ARCUI does not provide generic screen-reader gesture instructions. |
| label | string | required | — |
| icon | IIcon["type"] | required | — |
| iconPosition? | TTabIconPosition | — | — |
| accessibilityLabel? | string | — | — |
Tab Icon Content
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | required | — |
| badge? | TTabBadge | — | — |
| testID? | string | — | — |
| accessibilityHint? | string | — | Optional additional accessibility guidance. ARCUI does not provide generic screen-reader gesture instructions. |
| icon | IIcon["type"] | required | — |
| accessibilityLabel | string | required | Icon-only tabs require an explicit accessible name. |
Generated from the ARCUI 1.1.x TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
ITabBar
| Prop | Type | Default | Description |
|---|---|---|---|
| type? | TTabType | — | — |
| orientation? | TTabBarOrientation | — | — |
| sizeMode? | TTabBarSizeMode | — | — |
| segmentInset? | number | tokens.sizings.tabs.segmentInset | Inner spacing between the active segment indicator and its tab bounds. Only affects type="segment". Invalid or negative values fall back to tokens.sizings.tabs.segmentInset. |
| children | ReactNode | required | — |
| style? | StyleProp<ViewStyle> | — | — |
| testID? | string | — | — |
| activeTab | string | required | Current active tab. Tabs are controlled. The consumer is the semantic state owner. |
| onActiveTabChange? | (tab: string) => void | — | Called when ARCUI requests a tab change. Updating activeTab remains the consumer's responsibility. |
Generated from the ARCUI 1.1.x TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
ITabNavigation
| Prop | Type | Default | Description |
|---|---|---|---|
| type? | TTabType | — | — |
| tabBarPosition? | TTabBarPosition | — | — |
| tabBarLayout? | TTabBarLayout | "inline" | Controls whether the TabBar participates in layout or floats above the pager content. "inline" reserves layout space for the TabBar. "overlay" lets page content occupy the complete TabNavigation bounds and renders the TabBar above it. Overlay mode does not add content padding. |
| tabBarRadius? | number | — | Radius of the complete TabBar surface. When omitted, overlay bars use tokens.radius.tabs, segment bars keep their existing tokens.radius.tabs radius, and other inline bars remain square. Invalid or negative values fall back to that default behavior. |
| tabBarBackgroundColor? | string | — | Fixed background color for the complete TabBar surface in both themes. Takes priority over tabBarDarkBackgroundColor/tabBarLightBackgroundColor and the Tabs color tokens. |
| tabBarDarkBackgroundColor? | string | — | Dark-theme TabBar surface override. Used only when the matching light override is also provided. |
| tabBarLightBackgroundColor? | string | — | Light-theme TabBar surface override. Used only when the matching dark override is also provided. |
| tabBarSizeMode? | TTabBarSizeMode | — | — |
| tabBarAlignment? | TTabBarAlignment | "start" | Alignment of a content-sized TabBar along its available main axis. Has no visual effect while tabBarSizeMode is "fill". |
| tabBarInset? | number | tokens.sizings.tabs.outerInset | Outer spacing applied around the complete TabBar. Invalid or negative values fall back to tokens.sizings.tabs.outerInset. |
| segmentInset? | number | tokens.sizings.tabs.segmentInset | Inner spacing between the active segment indicator and its tab bounds. Only affects type="segment". Invalid or negative values fall back to tokens.sizings.tabs.segmentInset. |
| swipeEnabled? | boolean | — | — |
| children | ReactNode | required | — |
| style? | StyleProp<ViewStyle> | — | — |
| testID? | string | — | — |
| activeTab | string | required | Current active tab. Tabs are controlled. The consumer is the semantic state owner. |
| onActiveTabChange? | (tab: string) => void | — | Called when ARCUI requests a tab change. Updating activeTab remains the consumer's responsibility. |
Generated from the ARCUI 1.1.x TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
ITabScreen
Tab Text Content
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | required | — |
| badge? | TTabBadge | — | — |
| children | ReactNode | required | — |
| testID? | string | — | — |
| accessibilityHint? | string | — | Optional additional accessibility guidance. ARCUI does not provide generic screen-reader gesture instructions. |
| label | string | required | — |
| accessibilityLabel? | string | — | — |
Tab Icon Text Content
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | required | — |
| badge? | TTabBadge | — | — |
| children | ReactNode | required | — |
| testID? | string | — | — |
| accessibilityHint? | string | — | Optional additional accessibility guidance. ARCUI does not provide generic screen-reader gesture instructions. |
| label | string | required | — |
| icon | IIcon["type"] | required | — |
| iconPosition? | TTabIconPosition | — | — |
| accessibilityLabel? | string | — | — |
Tab Icon Content
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | required | — |
| badge? | TTabBadge | — | — |
| children | ReactNode | required | — |
| testID? | string | — | — |
| accessibilityHint? | string | — | Optional additional accessibility guidance. ARCUI does not provide generic screen-reader gesture instructions. |
| icon | IIcon["type"] | required | — |
| accessibilityLabel | string | required | Icon-only tabs require an explicit accessible name. |
Generated from the ARCUI 1.1.x TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
The generated table above covers ARCUI-owned public props from the source-aligned type snapshot. Native inherited surfaces remain available where the public type extends React Native props.
Motion
Tab selection remains controlled. Indicator/selection/layout motion is rendered separately from semantic active-tab ownership.
See Motion for the library-wide model.
Performance
Keep application semantics at normal React update cadence. ARCUI components avoid using React state as a frame-by-frame animation driver; use the component callbacks and let Reanimated own continuous visual work.
See Performance for broader guidance.
Accessibility
ARCUI uses native roles, labels, semantic accessibility state, centralized font scaling, and localizable ARCUI-owned strings where the component owns behavior text. Consumer accessibility overrides remain available when they do not conflict with component correctness.
See Accessibility for the library-wide model.
Theming
This component resolves its normal presentation from ARCUI tokens and active theme context. Prefer token configuration for system-wide design changes and component props for genuine instance-level exceptions.
Relevant token areas include:
colors.*.tab
colors.*.tabBar
sizings.tab
sizings.tabBar
typography.tab
tabAnimations
animationsTop-level token overrides are shallow. Compose changed built-in namespaces from defaultTokens rather than relying on recursive merge behavior.
Try it live
Explore Tabs interactively in Expo Snack.