Component packs › Transit › Scroll Line
The contents are a route beside the article: the line fills as you read, the train sits where you are and each station lights as you reach it.
Scroll Line is a table of contents from Transit, a component pack with 8 components: Navigation components drawn as one metro line. Price: $2 for the whole pack.
Built with: scrollspy, scroller only, motion profile scroll.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | Title over the contents. | |
sections | ScrollLineSection[] | ||
scroller | HTMLElement | Your own scroll container and section elements (instead of the demo article). | |
targets | HTMLElement[] | ||
onChange | (index: number) => void | ||
theme | 'dark' | 'light' | ||
autoplay | boolean | Showcase mode: reads down the article and back until touched. |
readonly index: numbergo(i: number): voiddestroy(): voidimport ScrollLine from './ScrollLine';
<ScrollLine />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Navigation and menus.