# Timeline

> A vertical list of events in order, for activity feeds, changelogs and order tracking.

Status: beta. Category: Data display.

```ts
import { Timeline, TimelineItem } from '@glyphui/ui'
```

Exports: `Timeline`, `TimelineItem`, `timelineStyles`.

## Notes

- Renders an ordered list, so screen readers announce the number of events.
- Pass dateTime alongside time so the <time> element carries a machine-readable date.

## TimelineItem props

| Prop | Type | Default | Description |
|---|---|---|---|
| `title` (required) | `ReactNode` |  |  |
| `children` | `ReactNode` |  | Description below the title. |
| `dateTime` | `string` |  | Machine-readable date for the `<time>` element, e.g. "2026-10-12T09:41". |
| `icon` | `ReactNode` |  | Replaces the dot in the marker. |
| `time` | `ReactNode` |  | Display text for when it happened, e.g. "2h ago" or "Oct 12". |
| `tone` | `"neutral" \| "primary" \| "info" \| "success" \| "warning" \| "danger"` |  |  |

## Example: Activity feed

Data-driven with the items prop.

```tsx
import { Timeline } from '@glyphui/ui'
import { GitCommitHorizontal, GitPullRequest, MessageSquare, Rocket } from 'lucide-react'

export default function Example() {
  return (
    <Timeline
      aria-label="Recent activity"
      className="max-w-md"
      items={[
        {
          title: 'Deployed v2.4.0 to production',
          time: '12 min ago',
          dateTime: '2026-10-17T09:41',
          icon: <Rocket />,
          tone: 'success',
          description: 'All 214 checks passed.',
        },
        {
          title: 'Merged “Add Combobox multi-select”',
          time: '1h ago',
          icon: <GitPullRequest />,
          tone: 'primary',
        },
        {
          title: 'Grace Hopper commented on #142',
          time: '3h ago',
          icon: <MessageSquare />,
          description: '“Keyboard support looks right, ship it.”',
        },
        { title: 'Pushed 3 commits to main', time: 'Yesterday', icon: <GitCommitHorizontal /> },
      ]}
    />
  )
}
```

## Example: Order tracking

Composed TimelineItem children with tones and icons.

```tsx
import { Timeline, TimelineItem } from '@glyphui/ui'
import { Check, Package, Truck } from 'lucide-react'

export default function Example() {
  return (
    <Timeline aria-label="Order #4821" className="max-w-sm">
      <TimelineItem title="Order placed" time="Oct 12, 09:14" icon={<Check />} tone="success">
        3 items · $148.00
      </TimelineItem>
      <TimelineItem title="Packed" time="Oct 12, 16:02" icon={<Package />} tone="success" />
      <TimelineItem title="Out for delivery" time="Today, 08:30" icon={<Truck />} tone="primary">
        Arrives between 2 pm and 4 pm.
      </TimelineItem>
      <TimelineItem title="Delivered" />
    </Timeline>
  )
}
```

Live page: https://glyphui.xyz/components/timeline
