---
title: "Scroll Progress"
description: "A thin bar or a small ring that shows how far the reader is through the page or one article, with an optional read percent."
url: https://gelatinui.com/components/scroll-progress
markdown_url: https://gelatinui.com/components/scroll-progress.md
access: free
install: "npx shadcn@latest add @gelatin-ui/scroll-progress"
registry_item: https://gelatinui.com/r/scroll-progress.json
version: "2026-11-17"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Scroll Progress

> A thin bar or a small ring that shows how far the reader is through the page or one article, with an optional read percent.

Page: https://gelatinui.com/components/scroll-progress

## When to use it

Best for: Long articles and docs, where a thin bar or a small ring shows how much is left to read.

- Use `ScrollProgressBar` under a sticky header, or with `fixed inset-x-0 top-0` at the top of the window.
- Use `target` to count one article, not the intro and footer of the page.
- Use `container` for a part inside a scroll panel.
- Use `ScrollProgressRing` with `ScrollProgressValue` to show the percent.

## When not to use it

- For the progress of a task, an upload, or a step, use [Progress](https://gelatinui.com/components/progress.md).
- For a button that goes back to the top with a ring, use [Back To Top](https://gelatinui.com/components/back-to-top.md).

## Notes for agents

- Every part must sit inside `ScrollProgress`: the parts read one Motion value from the root.
- React does not render while the page scrolls, so the parts cost no renders.
- The parts are `aria-hidden`. A ring in a Button takes its name from the Button `aria-label`.
- Set the ring size with a class; the default is `size-10`.
- `disabled` rests every part at 0 and stops the scroll work.

## Anatomy

```text
ScrollProgress
├─ ScrollProgressBar (0..n)
├─ ScrollProgressRing (0..n)
└─ ScrollProgressValue (0..n)
```

## API reference

### ScrollProgress

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `target` | `RefObject<HTMLElement \| null>` |  | The element to measure, for example an `<article>`. Without it the progress is the scroll of the whole page. |
| `container` | `RefObject<HTMLElement \| null>` |  | The element that scrolls, for a part inside a scroll area. Without it the page scroll counts. With no `target`, the progress is the scroll of this element. |
| `disabled` | `boolean` | false | Rests every part at 0 and stops the work. |

### ScrollProgressBar

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### ScrollProgressRing

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### ScrollProgressValue

No props of its own: `className`, `children`, and every other prop go to the element it renders.

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| ScrollProgress | `scroll-progress` |  |  |  |
| ScrollProgressBar | `scroll-progress-bar` |  |  |  |
| ScrollProgressRing | `scroll-progress-ring` |  |  |  |
| ScrollProgressValue | `scroll-progress-value` |  |  |  |

## Usage

Wrap the page or the post in `ScrollProgress`, and place a `ScrollProgressBar` under the sticky header. Pass `target` to count one article only.

```tsx title="blog-post.tsx"
import { useRef } from "react";
import type { ReactNode } from "react";

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

export function BlogPost({ title, children }: { title: string; children: ReactNode }) {
  const articleRef = useRef<HTMLElement>(null);
  return (
    <ScrollProgress target={articleRef}>
      <header className="sticky top-0 z-10 bg-background">
        <div className="mx-auto flex h-14 max-w-3xl items-center px-4">
          <span className="text-sm font-medium">{title}</span>
        </div>
        <ScrollProgressBar />
      </header>
      <article ref={articleRef} className="mx-auto max-w-3xl px-4 py-12">
        {children}
      </article>
    </ScrollProgress>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/scroll-progress
```

It adds 24 registry items: 21 files, 3921 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Progress](https://gelatinui.com/components/progress.md)
- [Back To Top](https://gelatinui.com/components/back-to-top.md)
- [Parallax](https://gelatinui.com/components/parallax.md)
- [Table of Contents](https://gelatinui.com/components/table-of-contents.md)

## Motion

| Part | Motion |
| --- | --- |
| Bar | none · the bar fills from the start edge with `scaleX` in each scroll frame |
| Ring | none · the ring closes clockwise from the top in each scroll frame |
