BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/atroui/scroll-progress

Scroll Progress

atroui/scroll-progress
FreeComponent

Reading-progress bar driven by scroll position.

Install it

npx shadcn@latest add https://atroui.com/r/scroll-progress.json

Source

registry/default/ui/scroll-progress.tsxatroui.com/r/scroll-progress.json
1"use client"
2
3import {
4 motion,
5 type SpringOptions,
6 useScroll,
7 useSpring,
8} from "motion/react"
9import type { RefObject } from "react"
10
11import { cn } from "@/lib/utils"
12
13export type ScrollProgressProps = {
14 className?: string
15 springOptions?: SpringOptions
16 containerRef?: RefObject<HTMLDivElement | null>
17}
18
19const DEFAULT_SPRING_OPTIONS: SpringOptions = {
20 stiffness: 200,
21 damping: 50,
22 restDelta: 0.001,
23}
24
25export function ScrollProgress({
26 className,
27 springOptions,
28 containerRef,
29}: ScrollProgressProps) {
30 const { scrollYProgress } = useScroll({
31 container: containerRef,
32 })
33
34 const scaleX = useSpring(scrollYProgress, {
35 ...DEFAULT_SPRING_OPTIONS,
36 ...(springOptions ?? {}),
37 })
38
39 return (
40 <motion.div
41 className={cn("inset-x-0 top-0 h-1 origin-left", className)}
42 style={{
43 scaleX,
44 }}
45 />
46 )
47}

What it pulls in

npm packages

  • motion

Other registry items

  • @atroui/utils

Files it writes

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

Facts

Registry
atroui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-11
Last confirmed
today

Go to the source

atroui.com atroui/atroui on GitHub Raw registry item This item as JSON

More from atroui

All 81 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
BreadcrumbsbreadcrumbsatrouiComponentsFree2 deps
ButtonbuttonatrouiComponentsFree2 deps
CardcardatrouiComponentsFreeno deps
Fade Infade-inatrouiComponentsFree1 dep
Form Selectform-selectatrouiComponentsFree2 deps
Founder Avatarfounder-avataratrouiComponentsFree1 dep
LogologoatrouiComponentsFreeno deps
Mockup Framemockup-frameatrouiComponentsFreeno deps
BlockDex

Built by

Kynth Studios

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 Studios

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 Studios

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