Design principles
Installation
$ pnpm dlx shadcn@latest add @synccn/scroll-progressFirst 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.
PropTypeDescription
- target
React.RefObject<HTMLElement | null>Scroll container to track. Defaults to the page.
- className
stringExtra 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
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
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
More navigation
BreadcrumbPath to the current page, with chevrons or slashes.PaginationPage numbers with ellipses for long ranges.StepperProgress through a multi-step flow.DockApp dock that magnifies icons near the pointer.Navigation MenuSite navigation with mega-menu panels.SidebarCollapsible app sidebar with groups, badges and nested items.