# Status Timeline

> The steps something goes through, with when each happened: an order, a deploy, an incident.

Page: https://uicontext.com/docs/components/status-timeline

Group: Navigation.

## When to use

The steps something goes through, with when each happened: an order, a deploy, an incident. Use [Activity Feed](https://uicontext.com/docs/components/activity-feed.md) instead when you show everything that happened to a record, not its stages.

## Usage

```ts
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

Each example is a complete file. Its imports point where the CLI installs the source.

### Order tracking

The example the page opens with: Status Timeline in “Order tracking”.

```ts title="src/demo.ts" source="www/src/examples/status-timeline/demo.ts"
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 next
export 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" },
			],
		}),
	)
```

### A deploy that failed

`meta` sits beside the time; `dense` tightens the steps for a side panel.

```ts title="src/deploy.ts" source="www/src/examples/status-timeline/deploy.ts"
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 took
export 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 |
| --- | --- | --- |
| `label` (required) | `string` | What the steps are of: "Order 4417", "Deploy to production". |
| `steps` (required) | `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

```sh
pnpm dlx shadcn@latest add checkfu/uicontext/status-timeline
```

With npm: `npx shadcn@latest add checkfu/uicontext/status-timeline`. With yarn: `yarn dlx shadcn@latest add checkfu/uicontext/status-timeline`. With bun: `bunx --bun shadcn@latest add checkfu/uicontext/status-timeline`.

It writes these files:

- `src/ui/uicontext/components/StatusTimeline.ts`
- `src/ui/uicontext/components/Sx.ts`
- `src/ui/uicontext/components/tokens.stylex.ts`

And installs the npm packages `@stylexjs/stylex`, `effect`.

## Source

- [src/StatusTimeline.ts](https://github.com/checkfu/uicontext/blob/main/src/StatusTimeline.ts)

## Related

- [App Shell](https://uicontext.com/docs/components/app-shell.md) (`app-shell`): The frame of an app: a sidebar, the page and an optional side panel, on any screen size.
- [Tab Strip](https://uicontext.com/docs/components/tab-strip.md) (`tab-strip`): Document tabs over the page to open, close and drag to reorder.
- [Sidebar](https://uicontext.com/docs/components/sidebar.md) (`sidebar`): A navigation tree of workspaces, teams and pages.
- [Tree View](https://uicontext.com/docs/components/tree-view.md) (`tree-view`): Nested rows you open and close, such as files and folders. Children can load when opened.
- [Page Header](https://uicontext.com/docs/components/page-header.md) (`page-header`): A page's title, description, breadcrumb and actions.
- [Tabs](https://uicontext.com/docs/components/tabs.md) (`tabs`): Switch between panels, or between views of the same data.
