Components

Tabs

Tabbed navigation with animated sliding indicator, horizontal/vertical orientation, and multiple visual variants.

iOSAndroid
Preview Tabs on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-tabs
Required Packages(1 package)
pnpm add react-native-reanimated

Usage

import {
  TabsRoot,
  TabsList,
  TabsTrigger,
  TabsContent
} from '@/components/docyrus-native/tabs';

<TabsRoot defaultValue="tab1">
  <TabsList>
    <TabsTrigger value="tab1">Overview</TabsTrigger>
    <TabsTrigger value="tab2">Settings</TabsTrigger>
  </TabsList>
  <TabsContent value="tab1">Overview content here.</TabsContent>
  <TabsContent value="tab2">Settings content here.</TabsContent>
</TabsRoot>

API Reference

TabsRoot

PropTypeDefaultDescription
valuestring—Controlled active tab value
defaultValuestring—Initial active tab value
onValueChange(value: string) => void—Callback when active tab changes
orientation'horizontal' | 'vertical''horizontal'Tab layout orientation
variant'default' | 'pills' | 'underline''default'Visual style variant
childrenReactNode—TabsList and TabsContent children
classNamestring—Additional CSS classes
accessibilityLabelstring'Tabs'Accessibility label for the tab list

TabsList

PropTypeDefaultDescription
scrollablebooleanfalseWrap triggers in a horizontal/vertical ScrollView
childrenReactNode—TabsTrigger children
classNamestring—List container CSS classes

TabsTrigger

PropTypeDefaultDescription
valuestring—Unique tab identifier (must match TabsContent value)
disabledbooleanfalseWhether the trigger is disabled
textClassNamestring—Text CSS classes
childrenReactNode—Trigger label
classNamestring—Trigger CSS classes

TabsContent

PropTypeDefaultDescription
valuestring—Tab identifier (must match TabsTrigger value)
childrenReactNode—Content to render when tab is active
classNamestring—Content area CSS classes

Components

ComponentDescription
TabsRootRoot container managing active tab state and context
TabsListContainer for tab triggers with animated sliding indicator (Reanimated spring)
TabsTriggerPressable tab button with layout measurement for indicator positioning
TabsContentContent panel with Reanimated fade-in/fade-out transitions

Type Exports

TypeDescription
TabsRootPropsProps for TabsRoot component
TabsListPropsProps for TabsList component
TabsTriggerPropsProps for TabsTrigger component
TabsContentPropsProps for TabsContent component
TabsOrientation'horizontal' | 'vertical'
TabsVariant'default' | 'pills' | 'underline'

On this page