BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/abui/scroll-progress

Scroll Progress

abui/scroll-progress
FreeComponent

A scroll progress indicator that shows reading progress as a horizontal bar at the top or bottom of the viewport.

Live preview

live · rendered by the registry
Rendered by abui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://abui.io/r/scroll-progress.json

Source

registry/abui/ui/scroll-progress.tsxabui.io/r/scroll-progress.json
1"use client"
2
3import { motion, useScroll } from "motion/react"
4import { cn } from "@/lib/utils"
5
6interface ScrollProgressProps extends React.ComponentProps<typeof motion.div> {
7 /**
8 * Height of the progress bar in pixels
9 * @default 2
10 */
11 height?: number
12 /**
13 * Color of the progress bar
14 * @default "bg-primary"
15 */
16 color?: string
17 /**
18 * Position of the progress bar
19 * @default "top"
20 */
21 position?: "top" | "bottom"
22 /**
23 * Container element to track scroll progress for
24 * If not provided, tracks the entire viewport
25 */
26 container?: React.RefObject<HTMLElement | null>
27}
28
29function ScrollProgress({
30 height = 4,
31 color = "bg-primary",
32 position = "top",
33 className,
34 container,
35 ...props
36}: ScrollProgressProps) {
37 const { scrollYProgress } = useScroll({
38 container: container as any,
39 })
40
41 return (
42 <motion.div
43 data-slot="scroll-progress"
44 className={cn(
45 "left-0 right-0 z-50 origin-left",
46 // Use fixed positioning for viewport scroll, allow override for container scroll
47 !container && "fixed",
48 position === "top" ? "top-0" : "bottom-0",
49 color,
50 className,
51 )}
52 style={{
53 scaleX: scrollYProgress,
54 height: `${height}px`,
55 }}
56 {...props}
57 />
58 )
59}
60
61export { ScrollProgress }

What it pulls in

npm packages

  • motion@12

Files it writes

  • registry/abui/ui/scroll-progress.tsx

Facts

Registry
abui
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
2 days ago

Go to the source

Docs on abui abui.io antoniobrandao/abui on GitHub Raw registry item This item as JSON

More from abui

All 20 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordion Multiselectaccordion-multiselectabuiComponentsFree3 deps
Breakpoint Displaybreakpoint-displayabuiComponentsFreeno deps
Color Swatch Selectorcolor-swatch-selectorabuiComponentsFreeno deps
Label Selectorlabel-selectorabuiComponentsFree2 deps
Radio Rowsradio-rowsabuiComponentsFreeno deps
Radio Tabsradio-tabsabuiComponentsFreeno deps
SpinnerspinnerabuiComponentsFree1 dep
Text Gradienttext-gradientabuiComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex