UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

Magic UI/Scroll Progress

Navigation
1 of 2
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

2 versions·2 librariesCompare all progress bars →

  • Magic UI
  • Motion Primitives

Scroll Progress

Animated Scroll Progress for your pages

npx shadcn@latest add https://magicui.design/r/scroll-progress.json
Open in v0 Docs Repo
Library
Magic UI
License
MIT
Stack
React · Tailwind CSS · animated
Packages
motion
Size
35 lines
Demo
From Magic UI

Code

registry/magicui/scroll-progress.tsx

"use client"

import { motion, useScroll, type MotionProps } from "motion/react"

import { cn } from "@/lib/utils"

interface ScrollProgressProps extends Omit<
  React.HTMLAttributes<HTMLElement>,
  keyof MotionProps
> {
  ref?: React.Ref<HTMLDivElement>
}

export function ScrollProgress({
  className,
  ref,
  ...props
}: ScrollProgressProps) {
  const { scrollYProgress } = useScroll()

  return (
    <motion.div
      ref={ref}
      className={cn(
        "fixed inset-x-0 top-0 z-50 h-px origin-left bg-linear-to-r from-[#A97CF8] via-[#F38CB8] to-[#FDCC92]",
        className
      )}
      style={{
        scaleX: scrollYProgress,
      }}
      {...props}
    />
  )
}

More like this

Scroll Index

Kokonut UI·Text effects

Pagination

shadcn/ui·Navigation

8-bit Health Bar

8bitcn·Feedback & loaders

8-bit Mana Bar

8bitcn·Feedback & loaders

8-bit Progress

8bitcn·Feedback & loaders

Badge

HextaUI·Data display

Safari

Magic UI·Media & 3D

8-bit Enemy Health Display

8bitcn·Feedback & loaders

8-bit Slider

8bitcn·Inputs & forms

Carousel

shadcn/ui·Media & 3D

Carousel

HextaUI·Media & 3D

Skeleton

shadcn/ui·Feedback & loaders

Accordion

SmoothUI·Data display

Border Trail

Motion Primitives·Cursor & effects

Side Panel

Cult UI·Other