Skip to content

Scroll Progress

The Scroll Progress component provides a visual indicator of how far a user has scrolled down a page. It’s useful for long-form content, giving users a sense of their reading progress.

Since OrbitUI components are copied directly into your project, you’ll add the Scroll Progress component using the OrbitUI CLI:

Terminal window
npx orbitkit@latest add scroll-progress

Import the ScrollProgress component into your Astro components or pages. By default, ScrollProgress renders a ScrollProgressBar internally, but you can also explicitly pass ScrollProgressBar as a child to customize it.

This progress bar is generally positioned at the top of your page.

The ScrollProgress component accepts all standard HTML attributes that a <div> element would. This allows you to apply general styling or additional attributes to the container of the scroll progress mechanism.

The ScrollProgressBar component also accepts all standard HTML attributes that a <div> element would. This is particularly useful when you want to directly style the visual progress bar itself, such as changing its background color.