GooseUI

Components

Timeline

New

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

Step 2 of 5

Installation

npx shadcn@latest add @gooseui/timeline
pnpm dlx shadcn@latest add @gooseui/timeline
yarn dlx shadcn@latest add @gooseui/timeline
bunx --bun shadcn@latest add @gooseui/timeline

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.

  1. Order placed

    Payment confirmed and receipt sent.

  2. Packed

    Two items packed at the warehouse.

  3. On the way

    The courier picks it up today.

  4. 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.

  1. Order placed

    Payment confirmed and receipt sent.

  2. Packed

    Two items packed at the warehouse.

  3. On the way

    The courier picks it up today.

  4. 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.

Step 2 of 5
<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.

  1. Idea
  2. Prototype
  3. Beta
  4. 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

PropTypeDefaultDescription
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
labelsPartial<Record<TimelineStatus, string>>{ completed: "Completed", … }Screen reader text for each status, read inside the marker
activeIndexnumber-Index of the current step. Sets the status of every item that has no status of its own
fromIndexnumber-Previous activeIndex. Makes transitions over several steps play in sequence
classNamestring-Additional CSS classes

TimelineItem

PropTypeDefaultDescription
status"completed" | "current" | "upcoming"-Step state. current also sets aria-current="step"
classNamestring-Additional CSS classes

TimelineConnector

PropTypeDefaultDescription
variant"solid" | "dashed""solid"Line style
classNamestring-Additional CSS classes

Components

ComponentDescription
TimelineRoot <ol>. Sets orientation and position
TimelineItemA step, <li>
TimelineMarkerCircle on the line. Shows a check, a dot or your icon passed as children
TimelineConnectorLine to the next step. Hidden on the last one
TimelineContentWrapper for title, description and time
TimelineTitleStep title
TimelineDescriptionSecondary text
TimelineTime<time> element, pass dateTime for machines