Timeline
import { Timeline } from '@hanzo/ui'
Default
A bordered card beside a connecting line, one per milestone.
Jan 1, 2024Project startedInitial planning and setup
Feb 15, 2024Development phaseBuilding core features
Mar 1, 2024TestingQuality assurance and bug fixes
export function Default() {return <Timeline items={milestones} />}
Horizontal
The same milestones read left to right instead of top to bottom.
Jan 1, 2024Project startedInitial planning and setup
Feb 15, 2024Development phaseBuilding core features
Mar 1, 2024TestingQuality assurance and bug fixes
export function Horizontal() {return <Timeline items={milestones} orientation="horizontal" />}
Alternate
Cards alternate left and right of a centered line.
Jan 1, 2024Project startedInitial planning and setup
Feb 15, 2024Development phaseBuilding core features
Mar 1, 2024TestingQuality assurance and bug fixes
export function Alternate() {return <Timeline items={milestones} variant="alternate" />}
Variants
Compact and simple render the same data without a card.
Project startedInitial planning and setup
Jan 1, 2024Development phaseBuilding core features
Feb 15, 2024TestingQuality assurance and bug fixes
Mar 1, 2024Jan 1, 2024Version 1.0 releasedInitial release with core features
CoreStable
Feb 15, 2024Version 2.0 betaMajor update
export function Variants() {const withContent: TimelineItem[] = [{id: "1",title: "Version 1.0 released",description: "Initial release with core features",date: "Jan 1, 2024",status: "completed",content: (<XStack gap="$2"><Badge>Core</Badge><Badge variant="secondary">Stable</Badge></XStack>),},{ id: "2", title: "Version 2.0 beta", description: "Major update", date: "Feb 15, 2024", status: "active" },]return (<YStack gap="$8"><Timeline items={milestones} variant="compact" /><Timeline items={withContent} variant="simple" /></YStack>)}
Types
export type TimelineStatus = 'completed' | 'active' | 'pending'
export type TimelineOrientation = 'vertical' | 'horizontal'
export type TimelineVariant = 'default' | 'alternate' | 'compact' | 'simple'
export interface TimelineItem {id: stringtitle: stringdescription?: stringdate?: stringtime?: stringstatus?: TimelineStatusicon?: React.ReactNodecontent?: React.ReactNode}
export interface TimelineProps extends Omit<YStackProps, 'children' | 'items'> {items: TimelineItem[]orientation?: TimelineOrientationvariant?: TimelineVariant/** Reveal rows as they scroll into view. Defaults to true. */animated?: boolean}
Exports
Timelinetype TimelineItemtype TimelineOrientationtype TimelinePropstype TimelineStatustype TimelineVariant