Skip to content
Haze UI

Timeline

Vertical ordered list of events, each with a marker on a connecting line, a title and an optional time and description.

pnpm dlx shadcn@latest add @haze/timeline
Open preview in a new tab
Liveno JavaScript

When to use

  • An order, shipment or incident history where the sequence matters
  • An activity feed in a settings or detail page
  • A short release or project history with a date per entry

When not to use

  • Steps the user has to complete in order; stepper shows progress and the current step
  • Long feeds that need paging; render a table or paginate the list

Installation

Add the Haze registry to components.json once, then install Timeline with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/timeline
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
items*{ title: string; date?: string; datetime?: string; description?: string; current?: boolean; icon?: Icon }[]–Events in display order. date is the visible text, so you control the format. datetime is the machine-readable value and turns the date into a <time> element. current marks the latest entry (the last item when none is marked). icon is a lucide component that replaces the dot with a chip.
classstring–Extra classes on the <ol>.

Accessibility

  • The latest entry has a solid marker; an entry can carry an icon chip instead of a dot.
  • An ordered list, so a screen reader announces "list, 4 items" and the position of each event.
  • The markers, icon chips and the connecting line are aria-hidden; order is carried by the list itself, not by the drawing. The current entry is marked only visually, so say so in its title or description if it matters.
  • Pass datetime to render the date as a <time> element; otherwise it is a plain paragraph. Write the visible date so it reads well aloud, for example "14 Nov 2026, 11:02".

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI component "Timeline" with `npx shadcn@latest add @haze/timeline`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Timeline from "@/components/haze/ui/timeline.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/ui/timeline.md

  • Customize with real content

    Adapt the Haze timeline ui for our product. Replace the demo values of these props with our real content: items, class. Keep the layout, the heading level rules and these accessibility details: The latest entry has a solid marker; an entry can carry an icon chip instead of a dot. An ordered list, so a screen reader announces "list, 4 items" and the position of each event. The markers, icon chips and the connecting line are aria-hidden; order is carried by the list itself, not by the drawing. The current entry is marked only visually, so say so in its title or description if it matters. Pass datetime to render the date as a <time> element; otherwise it is a plain paragraph. Write the visible date so it reads well aloud, for example "14 Nov 2026, 11:02". Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using timeline, check it fits: use it when an order, shipment or incident history where the sequence matters; an activity feed in a settings or detail page; a short release or project history with a date per entry. Avoid it when steps the user has to complete in order; stepper shows progress and the current step; long feeds that need paging; render a table or paginate the list. Alternatives: @haze/stepper, @haze/table, @haze/item.

Dependencies

  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog