Reading progress
Where you are in a long page, in a small pill that appears once you start scrolling: a ring that fills as you read, the section you are in and how far through you are. Press it to jump to another section.
When to use
- Long articles, guides and policies, especially on phones where there is no side outline.
- Reports read top to bottom.
When not to use
- Short pages that fit in two screens.
- Pages that already show an outline beside the text; use scroll spy nav there.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/reading-progress
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
ReadingProgress
6 props
PropTypeDefaultDescription
sections *readonly ReadingSection[]—The sections in page order; each id is an element on the page.
scrollRefRefObject<HTMLElement | null>—The element that scrolls; the window when absent.
placement"sticky" | "fixed""fixed""fixed" floats at the bottom of the window; "sticky" sits at the bottom of its scrolling parent (render it last inside that parent).
showAfternumber120Pixels scrolled before the pill appears.
labelstring"Reading progress"
classNamestring—
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It is built on native elements and keeps aria-current, aria-hidden, aria-expanded, aria-controls and aria-label in step with state.
Motion
- State changes animate with the library's shared durations and curves, so its timing matches every other part.
- Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/reading-progress.mdThe index of every part is at /llms.txt.
More in Compare & browse
Scroll spy navAn outline that follows your reading: a marker glides to the section in view, and choosing a link scrolls there and moves focus into it.Scroll effectsTools for effects that follow scroll position, such as progress and reveals.Docs sidebarDocumentation navigation and an on-page outline.