Docyrus

Timeline

Vertical timeline component with status indicators, left / alternate / right layouts, animated entrance, and interactive items.

iOSAndroid
Preview Timeline 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-timeline
Required Packages(1 package)
pnpm add react-native-reanimated

Usage

import { Timeline } from '@/components/docyrus-native/timeline';

<Timeline
  items={[
    { title: 'Order placed', description: 'Confirmed', time: '10:00 AM', status: 'completed' },
    { title: 'Shipped', description: 'On the way', time: '2:00 PM', status: 'active' },
    { title: 'Delivered', time: '—', status: 'pending' },
  ]}
  animated
/>

Alternate Layout

<Timeline
  layout="alternate"
  items={items}
/>

Right Layout

Content sits on the left of the line and is right-aligned — useful for RTL-feeling activity feeds.

<Timeline
  layout="right"
  items={items}
/>

With Item Press

<Timeline
  items={items}
  onItemPress={(item, index) => console.log(item.title, index)}
/>

onItemClick is accepted as a web-parity alias of onItemPress (both fire when both are set), so shared code written against the web Timeline works unchanged.

Custom Content Slot

<Timeline
  items={[
    {
      title: 'Shipped',
      status: 'active',
      content: <Badge variant="outline">In Transit</Badge>,
    },
  ]}
/>

API Reference

PropTypeDefaultDescription
itemsTimelineItem[]—Array of timeline events (required)
size'sm' | 'md' | 'lg''md'Timeline size
variant'default' | 'outline''default'Dot style variant
lineStyle'solid' | 'dashed''solid'Global connector line style
layout'left' | 'alternate' | 'right''left'Content position relative to the line — left = line on the left, right = line on the right (content right-aligned), alternate = zig-zag
animatedbooleanfalseStaggered fade-in entrance animation
onItemPress(item: TimelineItem, index: number) => void—Item press handler
onItemClick(item: TimelineItem, index: number) => void—Web-parity alias of onItemPress
classNamestring—Container class override
titleClassNamestring—Title text class override
descriptionClassNamestring—Description text class override
timeClassNamestring—Time text class override

TimelineItem

PropertyTypeDescription
titlestringEvent title
descriptionstringOptional description text
timestringOptional time label
iconReactNodeCustom icon (replaces dot)
dotColorstringCustom dot color (ignored when status is set)
statusTimelineStatusItem status — controls dot icon, line style, and content opacity
contentReactNodeRich content slot rendered below description
lineStyleTimelineLineStylePer-item line style override

Status

When status is set on an item, the dot, line, and content are styled automatically:

StatusDotLine BelowContent
completedGreen circle with check iconSolid primaryNormal
activePrimary circle with inner ringDashed primaryNormal
pendingSmall muted circleDashed mutedReduced opacity (60%)
errorRed circle with X iconSolid redNormal

Items without status use the variant prop for dot styling (backward compatible).

Type Exports

TypeDescription
TimelinePropsProps for Timeline component
TimelineItemTimeline event item type
TimelineSize'sm' | 'md' | 'lg'
TimelineVariant'default' | 'outline'
TimelineStatus'completed' | 'active' | 'pending' | 'error'
TimelineLineStyle'solid' | 'dashed'
TimelineLayout'left' | 'alternate' | 'right'

On this page