Cnippet

Scroll Progress

Component 12

About

A spring-animated progress bar that tracks scroll position — works for the full page or a scrollable container element.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Scroll Progress to your project and fits it to your theme.

Code

How Scroll Progress is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

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

export default function ScrollProgressFixed() {
  return (
    <div className="relative flex min-h-50 flex-col items-center justify-start overflow-y-auto px-6">
      <div className="sticky top-0 z-10 w-full">
        <ScrollProgress className="fixed top-0 right-0 left-0 h-1 bg-primary" />
      </div>
      <div className="w-full max-w-lg space-y-4 py-6">
        <h2 className="font-bold text-foreground text-xl">
          Scroll to see progress
        </h2>
        {Array.from({ length: 6 }).map((_, i) => (
          <p className="text-muted-foreground text-sm leading-relaxed" key={i}>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
            eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
            ad minim veniam, quis nostrud exercitation ullamco laboris.
          </p>
        ))}
      </div>
    </div>
  );
}

Dependencies

More by Cnippet

View all
  • Team

    Team

    1.3K
  • Davincho Hero-1

    Davincho Hero-1

    681
  • Aero Hero-3

    Aero Hero-3

    556
  • Features

    Features

    507
  • Random Letter Swap Navigation

    Random Letter Swap Navigation

    482
  • Services with Animated Hover Modal

    Services with Animated Hover Modal

    463
  • Blogs

    Blogs

    396
  • Aero Hero-1

    Aero Hero-1

    355