OPUS/UI

Navigation

Scroll Progress

A reading-progress bar for the page or any scroll container, animated with scaleX only.

scrolltransform2 files · 78 locdeps: clsx, tailwind-merge

Scroll this article

Paragraph 1. The bar above is a single element animated with transform: scaleX, updated at most once per frame from a passive scroll listener. Point it at the page (default) or any scroll container with the container prop.

Paragraph 2. The bar above is a single element animated with transform: scaleX, updated at most once per frame from a passive scroll listener. Point it at the page (default) or any scroll container with the container prop.

Paragraph 3. The bar above is a single element animated with transform: scaleX, updated at most once per frame from a passive scroll listener. Point it at the page (default) or any scroll container with the container prop.

Paragraph 4. The bar above is a single element animated with transform: scaleX, updated at most once per frame from a passive scroll listener. Point it at the page (default) or any scroll container with the container prop.

Paragraph 5. The bar above is a single element animated with transform: scaleX, updated at most once per frame from a passive scroll listener. Point it at the page (default) or any scroll container with the container prop.

Paragraph 6. The bar above is a single element animated with transform: scaleX, updated at most once per frame from a passive scroll listener. Point it at the page (default) or any scroll container with the container prop.

Paragraph 7. The bar above is a single element animated with transform: scaleX, updated at most once per frame from a passive scroll listener. Point it at the page (default) or any scroll container with the container prop.

Paragraph 8. The bar above is a single element animated with transform: scaleX, updated at most once per frame from a passive scroll listener. Point it at the page (default) or any scroll container with the container prop.

Paragraph 9. The bar above is a single element animated with transform: scaleX, updated at most once per frame from a passive scroll listener. Point it at the page (default) or any scroll container with the container prop.

Installation

With the shadcn CLI, pointing at this platform’s registry:

npx shadcn@latest add https://opusui.131199999.xyz/r/scroll-progress.json

Or offline, straight from your opus55 checkout (copies every file it needs):

node ../tailwind_component/opus55/scripts/add.mjs scroll-progress

Usage

import { ScrollProgress } from "@/components/opus/effects/scroll-progress";

<ScrollProgress />  // page
<ScrollProgress container={ref} />  // a scroll box

API

PropTypeDefaultDescription
containerRefObject<HTMLElement>—Scroll container (default: window).
colorstring—Bar background.
heightnumber3Bar height (px).
position"top" | "bottom""top"Edge.

Command palette