Scroll Progress

PreviousNext

A customizable scroll progress bar with gradient variants, sizes, and optional percentage display.

scroll-progress-default

Installation

pnpm dlx shadcn@latest add https://ui.dalim.in/r/styles/default/scroll-progress.json

Usage

import { ScrollProgress } from "@/components/ui/scroll-progress"
<div className="relative h-screen w-full overflow-hidden">
  <ScrollProgress variant={"ice"} showPercentage /> 
</div>

API Reference

ScrollProgress

PropTypeDefaultDescription
classNamestringAdditional Tailwind/CSS classes.
variant"default" | "rainbow" | "ocean" | "sunset" | "forest" | "monochrome" | "neon" | "fire" | "ice" | "gold" | "solid" | "custom""default"Preset gradient style for the progress bar.
size"xs" | "sm" | "default" | "lg" | "xl" | "2xl""default"Height of the progress bar.
position"top" | "bottom""top"Position of the progress bar on the screen.
rounded"none" | "sm" | "default" | "lg" | "xl" | "full""none"Rounding of the progress bar edges.
glow"none" | "sm" | "default" | "lg" | "xl""none"Shadow/glow intensity around the progress bar.
customGradientstringCustom Tailwind gradient classes when variant="custom".
springConfig{ stiffness?: number; damping?: number; restDelta?: number }{ stiffness: 200, damping: 50, restDelta: 0.001 }Configuration for spring animation.
showPercentagebooleanfalseWhether to show scroll percentage text.
percentagePosition"left" | "right" | "center""right"Where to display the percentage label.
containerReact.RefObject<HTMLElement>Optional scroll container to track instead of window.