Scroll progress
A bar or a small ring that shows how far a scroll container, or the page, has been read. It follows the scroll and does nothing else. For the progress of a task use the progress bar; for an outline that marks the section being read use the table of contents.
Install
npx shadcn@latest add @thrum-pro/scroll-progressThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | Required | What the progress is of. It is not drawn: it names the indicator for screen readers. |
target | RefObject<HTMLElement | null> | – | A ref to the scroll container to follow. Leave it out to follow the page. |
variant | "bar" | "ring" | Default "bar" | A bar that fills along its length, or a ring that fills clockwise from the top. |
size | "sm" | "md" | "lg" | Default "md" | Thickness of the bar (2, 4 or 6 pixels) or diameter of the ring (24, 32 or 40 pixels). |
className | string | – | Size and place it. The bar fills its container's width; fixed or sticky classes pin it to an edge. |
Motion and sound
Motion
- The fill follows the scroll position, read once a frame at most. It has no animation of its own, so there is nothing to reduce.
- The bar is scaled and the ring's dash is shifted: neither changes the layout of the page.
Sound
Silent. This component makes no sound.
Accessibility
- It has the progressbar role, named by its label, with a value from 0 to 100 and the same value as text with a percent sign.
- It is not focusable and takes no input. The scroll container is what a reader moves: make that one focusable so the keyboard can scroll it.
- With nothing to scroll the value is 0.
- The fill uses the primary colour and keeps 3 to 1 against the page in both themes. The empty track uses the border colour.
- The bar fills from the left, and from the right in right-to-left text.
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/scroll-progress.tsx- Packages
- None
- Brings along
- Nothing
Changelog
- 1.0.0 · 2026-12-03First release.