A compound timeline for order tracking, changelogs and roadmaps. Vertical or horizontal, content on either side or alternating, with completed, current and upcoming steps. It is an ordered list, and the current step carries aria-current="step". A server component with no JavaScript: markers pick their look from the item status in CSS, and the status names from labels reach screen readers as CSS generated content.
Preview
Installation
Usage
import {
Timeline,
TimelineConnector,
TimelineContent,
TimelineDescription,
TimelineItem,
TimelineMarker,
TimelineTime,
TimelineTitle,
} from "@/components/ui/timeline"
export function OrderStatus() {
return (
<Timeline>
<TimelineItem status="completed">
<TimelineMarker />
<TimelineConnector />
<TimelineContent>
<TimelineTime dateTime="2026-03-03T09:12">Mar 3, 09:12</TimelineTime>
<TimelineTitle>Order placed</TimelineTitle>
<TimelineDescription>Payment confirmed.</TimelineDescription>
</TimelineContent>
</TimelineItem>
<TimelineItem status="current">
<TimelineMarker />
<TimelineConnector />
<TimelineContent>
<TimelineTitle>On the way</TimelineTitle>
</TimelineContent>
</TimelineItem>
<TimelineItem status="upcoming">
<TimelineMarker />
<TimelineConnector />
<TimelineContent>
<TimelineTitle>Delivered</TimelineTitle>
</TimelineContent>
</TimelineItem>
</Timeline>
)
}Examples
Current step from activeIndex
Pass activeIndex and the statuses follow: earlier steps are completed, that one is current, the rest are upcoming. Changing it animates the line filling, the halo appearing and the check drawing, in both directions. Pass the previous value as fromIndex so a jump over several steps plays one step after another. A status set on an item still wins. Reduced motion turns the animation off.
const [state, setState] = useState({ active: 1, from: 1 })
const go = (index: number) =>
setState((s) => ({ active: index, from: s.active }))
<Timeline activeIndex={state.active} fromIndex={state.from}>
{steps.map((step, index) => (
<TimelineItem key={step.id} onClick={() => go(index)}>
<TimelineMarker />
<TimelineConnector />
<TimelineContent>
<TimelineTitle>{step.title}</TimelineTitle>
</TimelineContent>
</TimelineItem>
))}
</Timeline>Alternating sides
position="alternate" puts items on both sides of the line. Below 640 px it falls back to one column.
- Order placed
Payment confirmed and receipt sent.
- Packed
Two items packed at the warehouse.
- On the way
The courier picks it up today.
- Delivered
Expected on Mar 6.
<Timeline position="alternate">
{steps.map((step) => (
<TimelineItem key={step.id} status={step.status}>
<TimelineMarker />
<TimelineConnector />
<TimelineContent>
<TimelineTitle>{step.title}</TimelineTitle>
</TimelineContent>
</TimelineItem>
))}
</Timeline>Line on the right
position="right" moves the line to the right edge and aligns the text to it.
- Order placed
Payment confirmed and receipt sent.
- Packed
Two items packed at the warehouse.
- On the way
The courier picks it up today.
- Delivered
Expected on Mar 6.
<Timeline position="right">…</Timeline>Horizontal
orientation="horizontal" lays steps out in a row that scrolls when there is no room. Here position="left" means content below the line, and "right" means above.
<Timeline orientation="horizontal">
<TimelineItem status="completed">
<TimelineMarker />
<TimelineConnector />
<TimelineContent>
<TimelineTitle>Idea</TimelineTitle>
<TimelineTime>Jan</TimelineTime>
</TimelineContent>
</TimelineItem>
{/* … */}
</Timeline>Custom icons and dashed line
Put any icon inside TimelineMarker. The --timeline-marker variable sets the marker size, and variant="dashed" on the connector marks a plan rather than a fact.
- Idea
- Prototype
- Beta
- Launch
import { Rocket } from "lucide-react"
<Timeline
orientation="horizontal"
position="alternate"
className="[--timeline-marker:2rem]"
>
<TimelineItem status="upcoming">
<TimelineMarker>
<Rocket />
</TimelineMarker>
<TimelineConnector variant="dashed" />
<TimelineContent>
<TimelineTitle>Launch</TimelineTitle>
</TimelineContent>
</TimelineItem>
</Timeline>Props
Timeline
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "vertical" | "horizontal" | "vertical" | Direction of the line |
| position | "left" | "right" | "alternate" | "left" | Side of the content. In horizontal mode left is below and right is above |
| labels | Partial<Record<TimelineStatus, string>> | { completed: "Completed", … } | Screen reader text for each status, read inside the marker |
| activeIndex | number | - | Index of the current step. Sets the status of every item that has no status of its own |
| fromIndex | number | - | Previous activeIndex. Makes transitions over several steps play in sequence |
| className | string | - | Additional CSS classes |
TimelineItem
| Prop | Type | Default | Description |
|---|---|---|---|
| status | "completed" | "current" | "upcoming" | - | Step state. current also sets aria-current="step" |
| className | string | - | Additional CSS classes |
TimelineConnector
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "solid" | "dashed" | "solid" | Line style |
| className | string | - | Additional CSS classes |
Components
| Component | Description |
|---|---|
| Timeline | Root <ol>. Sets orientation and position |
| TimelineItem | A step, <li> |
| TimelineMarker | Circle on the line. Shows a check, a dot or your icon passed as children |
| TimelineConnector | Line to the next step. Hidden on the last one |
| TimelineContent | Wrapper for title, description and time |
| TimelineTitle | Step title |
| TimelineDescription | Secondary text |
| TimelineTime | <time> element, pass dateTime for machines |