Scroll Progress
Shows how far the reader has scrolled.
Installation
pnpm dlx shadcn@latest add @paneui/scroll-progressUsage
Examples
Accessibility
Both variants are a role="progressbar" with aria-valuenow from 0 to 100, kept in step without re-rendering. Name it with label. Under reduced motion the spring follow is off.
Inside a frame
A sticky bar takes no room in the flow: it overlays the content's edge, inset from the frame like the scrollbars, and its ends follow the frame's corners (radius less the inset), so it never runs past a rounded edge.
Related
Reads Smooth Scroll by default. See also Scroll To, Scroll Reveal.
ScrollProgress
A bar (default) or ring that fills with scroll progress from the nearest SmoothScroll, or the window outside one. Renders a div; no other props pass through.
- variant= "bar"
- "bar" | "ring"
- Indicator shape.
- progress
- MotionValue<number>
- Custom 0–1 source. Defaults to the nearest SmoothScroll (or the window).
- spring= true
- boolean
- Spring-smooth the indicator. Off automatically under reduced motion.
- label= "Reading progress"
- string
- Accessible name of the progressbar.
- className
- string
- Merged onto the root.
- side= "top"
- "top" | "bottom"
- Bar only. Edge the bar sticks to.
- position= "fixed"
- "fixed" | "sticky" | "absolute"
- Bar only.
fixedfor the page,stickyinside a scroll container,absoluteinside a relative box. - thickness= 3
- number
- Bar height or ring stroke width in px.
- inset
- number
- Bar only. Gap in px from the container's edges. A
stickybar defaults to its scroll area's scrollbar inset (4px) and bends with the frame's rounded corners; other positions default to 0. - size= 44
- number
- Ring only. Diameter in px.
- showValue= false
- boolean
- Ring only. Show the percentage in the middle.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "bar" | "ring" | "bar" | Indicator shape. |
| progress | MotionValue<number> | — | Custom 0–1 source. Defaults to the nearest SmoothScroll (or the window). |
| spring | boolean | true | Spring-smooth the indicator. Off automatically under reduced motion. |
| label | string | "Reading progress" | Accessible name of the progressbar. |
| className | string | — | Merged onto the root. |
| side | "top" | "bottom" | "top" | Bar only. Edge the bar sticks to. |
| position | "fixed" | "sticky" | "absolute" | "fixed" | Bar only. fixed for the page, sticky inside a scroll container, absolute inside a relative box. |
| thickness | number | 3 | Bar height or ring stroke width in px. |
| inset | number | — | Bar only. Gap in px from the container's edges. A sticky bar defaults to its scroll area's scrollbar inset (4px) and bends with the frame's rounded corners; other positions default to 0. |
| size | number | 44 | Ring only. Diameter in px. |
| showValue | boolean | false | Ring only. Show the percentage in the middle. |
- data-variant
barorringon the root.
| Data attribute | Description |
|---|---|
| data-variant | bar or ring on the root. |