ScrollProgress

Ring that pops in as you scroll, counts the percent read, turns green at the end and becomes a back-to-top arrow on hover. Also a thin bar variant. Effects.

Open playground

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

Scroll this panel. The bar and ring follow your progress; point at the ring to go back to the top.

About

ScrollProgress is a React component in the Effects category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { ScrollProgress } from "@ashutoshswamy/smoui" and set container, variant, label.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { ScrollProgress } from "@ashutoshswamy/smoui";

<div className="fixed bottom-6 right-6">
  <ScrollProgress />
</div>

Props 3

container

Scroll container. Omit to follow the page.

RefObject<HTMLElement>
variant

Back-to-top ring or full-width reading bar.

"ring""bar"default "ring"
label

Accessible name.

stringdefault "Back to top"