The steps something goes through, with when each happened: an order, a deploy, an incident.
- 1.7 kB JS 3.1 kB CSS gzipped
- No serious axe issues
- Server-rendered, hydrates
- 44px touch targets
- Right-to-left
- 9 tests
Done: Ordered
Done: Packed
2 parcels from the Leeds warehouseDone: Shipped
Now: Out for delivery
Arriving between 13:00 and 15:00. Your driver is Sam.Next: Delivered
import type { Html } from "effect/ui/html"import * as stylex from "@stylexjs/stylex"import { StatusTimeline } from "./ui/uicontext/components/StatusTimeline.ts"import { sx } from "./ui/uicontext/components/Sx.ts"const styles = stylex.create({ wrap: { inlineSize: "min(100%, 26rem)" } })// an order's tracking page: what happened, what's happening, what's nextexport const OrderTracking = <M>(h: Html.H<M>) => h.div.attrs(sx(styles.wrap)).children( StatusTimeline(h, { label: "Order 4417", steps: [ { title: "Ordered", state: "done", time: "Mon 2 Dec, 09:14", datetime: "2026-12-02T09:14:00Z" }, { title: "Packed", state: "done", time: "Mon 2 Dec, 16:40", datetime: "2026-12-02T16:40:00Z", description: "2 parcels from the Leeds warehouse" }, { title: "Shipped", state: "done", time: "Tue 3 Dec, 07:05", datetime: "2026-12-03T07:05:00Z" }, { title: "Out for delivery", state: "current", time: "Today, 08:22", description: "Arriving between 13:00 and 15:00. Your driver is Sam." }, { title: "Delivered", state: "upcoming" }, ], }), )When to use
The steps something goes through, with when each happened: an order, a deploy, an incident. Use Activity Feed instead when you show everything that happened to a record, not its stages.
Usage
import { StatusTimeline } from "./ui/uicontext/components/StatusTimeline.ts"export const Refund = <M>(h: Html.H<M>) => StatusTimeline(h, { label: "Refund", steps: [{ title: "Requested", state: "done", time: "2 Dec" }, { title: "Approved", state: "current", time: "Today" }, { title: "Paid back", state: "upcoming" }], })Examples
A deploy that failed
meta sits beside the time; dense tightens the steps for a side panel.
Done: Build
1m 48sDone: Tests
3m 12sDone: Migrate database
22sFailed: Health check
30sGET /healthz returned 503 three timesNext: Switch traffic
import type { Html } from "effect/ui/html"import * as stylex from "@stylexjs/stylex"import { StatusTimeline } from "./ui/uicontext/components/StatusTimeline.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { color, font, typography } from "./ui/uicontext/components/tokens.stylex.ts"const styles = stylex.create({ wrap: { inlineSize: "min(100%, 28rem)" }, code: { fontFamily: typography.codeFamily, fontSize: font.xs, color: color.danger },})// a deploy that failed at its health check, with how long each step tookexport const FailedDeploy = <M>(h: Html.H<M>) => h.div.attrs(sx(styles.wrap)).children( StatusTimeline(h, { label: "Deploy 8f3c2a1 to production", dense: true, steps: [ { title: "Build", state: "done", time: "14:02", meta: "1m 48s" }, { title: "Tests", state: "done", time: "14:04", meta: "3m 12s" }, { title: "Migrate database", state: "done", time: "14:07", meta: "22s" }, { title: "Health check", state: "failed", time: "14:08", meta: "30s", description: h.span.attrs(sx(styles.code)).children("GET /healthz returned 503 three times") }, { title: "Switch traffic", state: "upcoming" }, ], }), )API reference
Options
| Name | Type | Description |
|---|---|---|
labelrequired | string | What the steps are of: "Order 4417", "Deploy to production". |
stepsrequired | TimelineStep<Message>[] | — |
dense | boolean | Less room between steps, for a side panel. |
working | boolean | The current step pulses while it's working; off for a step that's waiting on someone. |
style | Style | — |
Installation
pnpm dlx shadcn@latest add checkfu/uicontext/status-timeline