BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/motion-primitives/scroll-progress

Scroll Progress

motion-primitives/scroll-progress
FreeComponent

A component that visualizes scroll progress with animated indicators.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/ibelick/motion-primitives/HEAD/public/c/scroll-progress.json

Source

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

What it pulls in

npm packages

  • motion

Files it writes

  • components/core/scroll-progress.tsx

Facts

Registry
motion-primitives
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
2 days ago

Go to the source

motion-primitives.com ibelick/motion-primitives on GitHub Raw registry item This item as JSON

More from motion-primitives

All 33 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionmotion-primitivesComponentsFree1 dep
Animated Backgroundanimated-backgroundmotion-primitivesComponentsFree1 dep
Animated Groupanimated-groupmotion-primitivesComponentsFree1 dep
Animated Numberanimated-numbermotion-primitivesComponentsFree1 dep
Border Trailborder-trailmotion-primitivesComponentsFree1 dep
Carouselcarouselmotion-primitivesComponentsFree1 dep
Cursorcursormotion-primitivesComponentsFree1 dep
Dialogdialogmotion-primitivesComponentsFree1 dep · 2 files
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