Reading rail
A scrollable article with a rail beside it. Pace is measured from the position of a reading line, in buckets of a few seconds, with skimming, re-reading and being away counted separately. The rail colours each paragraph by how long you spent there against your own pace and the time left is recomputed as you speed up or slow down. It measures the page moving, not eyes or understanding, and the thresholds are settings of this demo, not findings. Nothing is stored or sent. With reduced motion nothing eases.
- Scroll Measurement
- Pure Functions
- ResizeObserver
- prefers-reduced-motion
reading-rail
A page that notices how you read
A list that reorders itself the instant you drop an item feels broken, even when the new order is correct. Nothing connects where the row was to where it went, so you have to find it again.
Motion fixes that, but only if it carries information. A row that glides to its new place tells you which row moved and where it landed. A row that bounces for its own sake tells you nothing.
The same test applies to text. A page can animate a progress bar as you scroll, but a bar that only fills is a thermometer. It says how far you are, and nothing about how you are going.
Reading is slower than scrolling. A person can move a page far faster than they can take in its words, so scroll speed alone says very little about reading, and a single fast flick would swamp any average.
So this rail does not measure each scroll event. It groups the position of a reading line into buckets of a few seconds and asks how many words passed through the line in each bucket.
A bucket that passes words faster than a skimming limit is set aside as skimming. A long run with no movement is set aside as being away. Neither is allowed to drag the estimate around.
What is left is time spent with the reading line moving at a plausible pace, plus short pauses, which count as reading because people stop to think. Words divided by that time is the pace.
Scrolling backwards is counted separately, as re-reading. It adds to the time spent but not to the words passed, so going back over a hard paragraph lowers the pace instead of inflating it.
With a pace, the remaining words give a time left. That figure moves as you speed up or slow down, and it is only as good as the last stretch it was measured on, which is why it says so.
The rail itself is the second readout. Each paragraph is a segment as tall as its word count. Once you have a pace, each segment is coloured by how long you spent there compared with how long it takes at that pace.
Under a set fraction of that time counts as skimmed, about that long as read, and much more as lingered on. The fractions are settings in this demo, listed in the evidence column, not facts about how people read.
Colour alone is a poor way to say anything, so the legend under the rail repeats each colour in words, with a count of paragraphs of each kind. The rail is a summary of those counts, not a replacement for them.
Nothing here can see your eyes. A page left scrolled to the middle while you make tea looks the same as a page being read slowly, until the idle rule notices, and a fast reader who barely moves the page looks slow.
It also cannot tell whether anything was understood. Scrolling at an even pace past text you did not take in produces a healthy-looking number. The measure is of the page moving, and a proxy at best.
That limit is the reason the measurement stays on this page. It is not sent anywhere, it is not stored, and the reset button clears every sample. Reloading does the same.
If you turn on reduced motion, the rail still updates but nothing eases: the marker jumps, colours change at once, and the page never scrolls itself. The skip button moves the page instantly either way.
Try it three ways. Scroll steadily and watch the pace settle. Stop on a paragraph and watch it turn into a linger. Then use the skip button and watch those words be counted as skimmed instead of read.
The keyboard works the same as the wheel. Focus the article, then use the arrow keys, Page Down or Space. Whatever moves the reading line is measured, because the measure only ever sees the line.
Everything in the evidence column comes from the samples taken while you used the page, through the same functions the unit tests run. Until you have scrolled, it says so, and shows no number at all.
That is the end of the article. If the rail is full, the last stretch is the one the estimate leans on, because the time left is measured over the most recent half minute of your reading.
- not reached0
- visited, no pace yet0
- skimmed0
- read0
- lingered0
Usage
Drop it in
import { ReadingRailPanel } from "@/app/lib/components/reading-rail";Accessibility
Works with
- Cursor
- Reacts to where the pointer is, not just whether it's over the element.
- Touch
- Follows your finger while it's down, then settles a moment after you lift.
- Keyboard
- Focus lights it up the way the cursor does. Every action has a key.
- Reduced motion
- Nothing moves or springs. Colour still answers, without drifting.