# M scroll progress 2

> In-container progress — gradient bar in card header scoped to a scrollable div

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/m-scroll-progress-2).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/m-scroll-progress-2
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/m-scroll-progress-2-light-206001f36d943bfe.png
- Registry item: https://ui.cnippet.dev/r/m-scroll-progress-2.json
- Categories: scroll progress
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/m-scroll-progress-2.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/scroll-progress`

## Files

### `registry/default/motion-variants/m-scroll-progress-2.tsx`

```tsx
"use client";

import { useRef } from "react";
import { ScrollProgress } from "@/registry/default/motion/scroll-progress";

export default function ScrollProgressContainer() {
  const containerRef = useRef<HTMLDivElement>(null);

  return (
    <div className="flex min-h-50 items-center justify-center px-6">
      <div className="w-full max-w-sm overflow-hidden rounded-xl border border-border bg-card shadow-sm">
        <div className="relative border-border border-b bg-card/80 px-4 py-3">
          <p className="font-semibold text-foreground text-sm">Changelog</p>
          <ScrollProgress
            className="absolute right-0 bottom-0 left-0 h-0.5 bg-gradient-to-r from-violet-500 to-pink-500"
            containerRef={containerRef}
          />
        </div>
        <div
          className="h-48 overflow-y-auto p-4 text-muted-foreground text-sm"
          ref={containerRef}
        >
          {["v1.3", "v1.2", "v1.1", "v1.0"].map((v) => (
            <div className="mb-4" key={v}>
              <p className="mb-1 font-semibold text-foreground">{v}</p>
              <p className="leading-relaxed">
                Added new animated components, improved accessibility, fixed
                scroll-jank in Safari, and bumped peer deps to Motion 12.
              </p>
            </div>
          ))}
        </div>
      </div>
    </div>
  );
}
```
