Scroll Thread

One line that draws through the page and lights each step as it arrives.

PROGet Scroll Thread and 168 other Pro components with pro lifetime — Get Pro

Category
Creative
Access
Pro
Source
226 lines · one file
States
5 drawn

The decision inside it

The thread is measured through the steps

The path is routed through where each step's heading actually lands, so long and short steps keep their node at any width and after any re-wrap. A fixed SVG path drifts off its steps at the first breakpoint. Reduced motion draws it complete.

When to use it

Use Scroll Thread for a sequence read top to bottom: a changelog, a how-it-works, a story. The line draws down to the step you are reading.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Scroll Thread for this.
Install it: npx shadcn@latest add @liro/scroll-thread
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/scroll-thread.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/changelog.tsx
import { ScrollThread } from "@/components/ui/scroll-thread";

const RELEASES = [
  { eyebrow: "Oct 14 · v2.4", title: "Agent approvals on mobile", body: "Approve or reject a run from your phone." },
  { eyebrow: "Sep 30 · v2.3", title: "Billing pages, twice as fast", body: "Invoices load before the first paint." },
];

export function Changelog() {
  return <ScrollThread items={RELEASES} />;
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
itemsScrollThreadItem[] Yes–
containedboolean NoScroll inside its own box rather than with the page.
heightnumber NoHeight of the box when `contained`, in px. Default 440.
threadClassNamestring NoColour class for the drawn thread, read as `text-*`. Default blue.

Dependencies

npm packages

clsxframer-motiontailwind-merge

Liro foundations, installed alongside it

liro-theme

States

All of them are drawn by the component. None is left for you to design.

  • Unread
  • Reading
  • Step reached
  • Complete
  • Reduced motion

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances