# Changelog trace

> What shipped, routed like a circuit: the line steps aside between releases, and a bead runs down it as you read.

The straight rail is the changelog everyone has. Here the line is a trace: it runs straight through each release and steps aside in the space between, with rounded bends, like a track on a circuit board. As you scroll, a bead runs down it a beat behind the page, takes every bend, and fills each release’s dot as it gets there. Filter to New, Improved or Fixed and the releases that don’t match fold away while the trace re-routes around them, each step flattening as its gap closes. Entries rise out of a light blur the first time they come into view, older releases wait behind "Show 3 older", and every release has an anchor you can link to.

## Install

```bash
npx shadcn@latest add https://hairlineui.com/r/changelog-trace.json
```

Needs React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.

- npm: none
- Hairline UI components it needs (the CLI installs them too): `number-roll`, `text-morph`
- Docs and live preview: https://hairlineui.com/ui/changelog-trace
- Registry item (source): https://hairlineui.com/r/changelog-trace.json

## Usage

```tsx
import { ChangelogTrace } from "@/components/changelog-trace";

<ChangelogTrace
  entries={[
    { id: "shift-planner", date: "2026-10-06", version: "v2.8", title: "Shift planner", tags: ["new"], body: <p>Drag shifts onto the week…</p> },
    { id: "receipt-fix", date: "2026-09-15", version: "v2.6.4", title: "Receipts print the right shop name", tags: ["fixed"] },
  ]}
/>
```

## From Markdown files

Keep one file per release and render them into the trace on a /changelog page.

```tsx
import { ChangelogTrace } from "@/components/changelog-trace";
import { getReleases } from "@/lib/releases"; // reads content/changelog/*.mdx

export default async function ChangelogPage() {
  const releases = await getReleases();
  return (
    <main className="mx-auto max-w-3xl px-6 py-24">
      <h1 className="mb-12 text-5xl font-medium tracking-[-0.04em]">Changelog</h1>
      <ChangelogTrace
        initialCount={8}
        entries={releases.map((r) => ({ id: r.slug, date: r.date, version: r.version, title: r.title, tags: r.tags, body: <r.Content /> }))}
      />
    </main>
  );
}
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `entries` | `ChangelogEntry[]` | – | Newest first: id (its anchor), date, title, and any of version, tags, body, media. |
| `initialCount` | `number` | `4` | How many show before "Show older". |
| `filters` | `{ tag; label }[]` | – | The switch’s options; by default the tags found in the entries (new, improved and fixed get their own labels and tints). |
| `locales` | `string \| string[]` | `"en-GB"` | How dates read. |

## States

- **read**: The drawn part of the trace follows a point 55% of the way down the screen, easing toward it (120ms time constant) so it trails your scroll slightly instead of being nailed to it.
- **bead**: A 5px bead rides the tip of the drawn line through every 45° bend; a dot’s centre fills (420ms, slight overshoot) and its ring darkens when the bead reaches it. The bead fades out at either end of the trace.
- **filter**: The pill is thrown to the chosen tag (460ms); releases without it fold to nothing (480ms) and the trace is re-laid every frame of the fold, so its steps shrink and the bends close up with them. The count rolls.
- **arrive**: Each release rises 14px out of a 4px blur (700ms) the first time it scrolls into view.
- **older**: Beyond initialCount, releases fold open on "Show 3 older", whose label morphs to "Show fewer"; the trace grows down into them.

## What it handles

The straight rail is the changelog everyone has. This one routes the line round the releases like a track on a circuit board, and keeps routing correctly when people filter.

- **A line that steps aside**: The trace runs straight through each release and steps aside in the gaps, with rounded bends.
- **A bead rides it as you read**: It runs a beat behind the page, takes every bend and fills each release’s dot when it arrives.
- **It re-routes when you filter**: As releases fold away, the trace is laid out again every frame, so its steps shrink and the bends close up.
- **Filter by kind**: New, Improved and Fixed tags in a switch, with the count rolling as it changes.
- **Older releases wait**: “Show 3 older” folds them open and the trace grows down into them.
- **Linkable and readable**: Every release has an anchor, the list is real markup, and the trace itself is hidden from assistive tech.

## Replaces

an SVG path layout, scroll-driven line drawing, tag filters, a show-more list, anchor links

## Where it fits

- **A public /changelog page**: Release notes with a layout people remember.
- **Developer tool sites**: Infrastructure and API products where a circuit-board look suits the brand.
- **Product update pages**: A changelog that people can filter by New, Improved or Fixed.
- **Launch pages**: Show the pace of shipping with a line that moves as people read.

## Notes

- An ordered list of articles with real <time> elements; each title links to its own anchor. The trace and bead are decoration and hidden from assistive tech.
- The filter is a radio group (arrow keys move); the count of updates is announced politely when it changes.
- Folded releases are inert and hidden from assistive tech.
- The trace is one SVG path laid out from where the dots sit. Scrolling writes its dash offset and the bead’s position straight to the SVG, once a frame, only while the timeline is on screen and only until the bead catches up; React re-renders only when a dot lights.
- Installs Number roll and Text morph. With reduced motion the line keeps pace with the scroll exactly and nothing slides.

License: MIT (https://hairlineui.com/license#components)
