Back
Scroll Progress
Satu Visual ComponentNew
A top bar that fills as the page is scrolled.
Scroll progress bar (fixed to top on your page)
Installation
Add it with the CLI:
Terminal
$
Or open the Code tab above and copy it in manually — it relies on the standard cn() helper from @/lib/utils.
Usage
Mount once near the root. Fixed to the top; pass a targetRef to track a specific element instead of the page.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| color | string | #8b5cf6 | Bar color. |
| targetRef | RefObject | — | Element to measure (defaults to page). |
| className | string | — | Extra classes. |