Skip to content
synccn

Scroll Progress

Reading progress bar for the page or any scroll container.

Design principles

Good components start with good defaults. A button should look right the moment you drop it in, and still bend to fit your brand.

Accessibility is part of the default. Every interactive part has the right role, works with the keyboard and keeps a visible focus ring.

Theming runs on CSS variables. Change one value and every component follows, in light and dark.

Motion explains change. It's there when something opens, moves or confirms an action, and it steps aside when people ask for less.

Copy the code, own the code. When we improve a component you can see the diff and decide what to take.

Good components start with good defaults. A button should look right the moment you drop it in, and still bend to fit your brand.

Accessibility is part of the default. Every interactive part has the right role, works with the keyboard and keeps a visible focus ring.

Theming runs on CSS variables. Change one value and every component follows, in light and dark.

Motion explains change. It's there when something opens, moves or confirms an action, and it steps aside when people ask for less.

Copy the code, own the code. When we improve a component you can see the diff and decide what to take.

Installation

$ pnpm dlx shadcn@latest add @synccn/scroll-progress

First time in this project? Connect synccn with one command.

Usage

import { ScrollProgress } from "@/components/ui/scroll-area";<ScrollProgress target={ref} />

API reference

Generated from the component's TypeScript types, so it always matches the code.

ScrollProgress

A thin bar that fills as a scroll container (or the page) is read.

  • target
    React.RefObject<HTMLElement | null>

    Scroll container to track. Defaults to the page.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA roles: progressbar
  • ARIA attributes: aria-label, aria-valuemax, aria-valuemin, aria-valuenow
  • Shows a visible focus ring for keyboard users