LayerwiseLayerwise
  • Features
  • Pricing
  • Templates
  • Docs
DownloadDownload
FeaturesPricingTemplatesDocsAI Website BuilderVibe CodingPersonal Software
DownloadDownload
  1. Glossary
  2. /
  3. Scroll effects

Scroll progress bar

Also called reading progress bar or reading indicator

A thin bar at the top of a page that fills from left to right as the reader scrolls, showing how much of the article is left.

import { useRef, type ReactNode } from 'react';
import { motion, useScroll, useSpring } from 'motion/react';

export function ArticleWithProgress({ children }: { children: ReactNode }) {
  const ref = useRef<HTMLElement>(null);
  // 0 at the top of the article, 1 when its end reaches the bottom of the viewport.
  const { scrollYProgress } = useScroll({
    target: ref,
    offset: ['start start', 'end end']
  });
  // A light spring smooths out jumpy mouse wheels.
  const scaleX = useSpring(scrollYProgress, {
    stiffness: 200,
    damping: 40,
    restDelta: 0.001
  });

  return (
    <>
      {/* scaleX with origin-left fills the bar without triggering layout. */}
      <motion.div
        aria-hidden='true'
        style={{ scaleX }}
        className='fixed inset-x-0 top-0 z-50 h-[3px] origin-left bg-blue-600'
      />
      <article ref={ref} className='mx-auto max-w-prose px-6 py-16'>
        {children}
      </article>
    </>
  );
}
Add a reading progress bar to blog posts: a 3px bar fixed to the top of the viewport, in the brand color, that grows from 0 to full width as the reader scrolls from the top of the article to its end. Animate transform: scaleX with transform-origin: left, smooth it with a light spring, hide it on posts shorter than two screens, and mark it aria-hidden.

Paste into Layerwise or any AI coding tool.

What is Scroll progress bar?

A scroll progress bar turns how far you have scrolled into the width of a bar, usually 3 to 4px tall and pinned to the top of the screen. It answers a quiet question during long reads: how much is left?

Use it on long articles, docs, and guides; on short pages it fills almost instantly and adds nothing. Animate it with transform: scaleX() and transform-origin: left, which the browser can update without recalculating layout, so it stays smooth on long pages.

CSS alone can drive it with animation-timeline: scroll() in browsers that support it, and Motion’s useScroll works everywhere. The bar is decorative, so mark it aria-hidden.

Often confused with

Progress bar
A progress bar shows how far along a task is, like an upload. A scroll progress bar shows how far down the page you have read.

Related terms

All terms

Scroll-driven animation

An animation whose progress is tied directly to the scroll position, so it moves forward as you scroll down and rewinds as you scroll up.

Sticky header

A top bar that stays pinned to the top of the screen while the page scrolls underneath it, so navigation is always one click away.

Scale

A CSS transform that draws an element larger or smaller around its transform origin, without pushing neighboring elements.

Spring animation

An animation driven by simulated spring physics in place of a fixed duration and curve, so motion can overshoot, settle, and react naturally.

Build it with Layerwise

Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.

DownloadDownloadRead the docs
LayerwiseLayerwise

Build full-stack web apps in minutes with AI.

Product

  • Features
  • Pricing
  • Download
  • Templates

Solutions

  • AI Website Builder
  • Vibe Coding
  • Personal Software

Resources

  • Documentation
  • Changelog
  • Blog
  • Vibe Coding Glossary
  • llms.txt
  • llms-full.txt

Company

  • About
  • Contact

Legal

  • Privacy
  • Analytics Privacy
  • Terms
  • Security
  • Abuse

© 2026 Layerwise. All rights reserved.

Entrances & exits

  • Fade in
  • Slide in
  • Scale in
  • Pop in
  • Blur in
  • Reveal animation
  • Enter and exit animations

Timing & sequencing

  • Duration
  • Delay
  • Keyframes
  • Tweening
  • Stagger
  • Orchestration
  • Fill mode
  • Stepped animation
  • Looping animation
  • Yoyo animation

Easing

  • Easing
  • Linear easing
  • Ease-in
  • Ease-out
  • Ease-in-out
  • Cubic-bezier
  • Asymmetric easing
  • Overshoot easing

Springs & physics

  • Spring animation
  • Stiffness
  • Damping
  • Mass
  • Bounce
  • Velocity
  • Momentum
  • Interruptible animation
  • Rubber-banding

Transforms

  • Translate
  • Scale
  • Rotate
  • Skew
  • 3D flip
  • Perspective
  • Transform origin
  • Origin-aware animation

State transitions

  • Crossfade
  • Morph
  • Shared element transition
  • Layout animation
  • Height auto animation
  • Direction-aware transition
  • Continuity transition
  • Page transition
  • View Transitions API

Scroll effects

  • Scroll reveal
  • Scroll-driven animation
  • Parallax scrolling
  • Scrollytelling
  • Scroll pinning
  • Horizontal scroll section
  • Scroll progress bar
  • Scroll snap
  • Smooth scrolling

Interaction feedback

  • Hover effect
  • Press feedback
  • Ripple effect
  • Shake animation
  • Hold to confirm
  • Drag gesture
  • Drag to reorder
  • Swipe to dismiss
  • Pull to refresh
  • Magnetic button
  • Custom cursor
  • 3D tilt card
  • Spotlight card

Text effects

  • Typewriter effect
  • Text scramble
  • Split text animation
  • Text morph
  • Rotating words
  • Gradient text
  • Shimmer text
  • Number ticker
  • Tabular numbers
  • Underline animation

Loops & ambient motion

  • Marquee
  • Pulse animation
  • Float animation
  • Orbit animation
  • Idle animation
  • Particle background
  • Border beam
  • Confetti
  • Animated gradient

Visual effects

  • Blur
  • Clip-path
  • Mask
  • Before/after slider
  • SVG line drawing
  • Lottie animation

Motion principles

  • Purposeful animation
  • Anticipation
  • Follow-through
  • Squash and stretch
  • Perceived performance
  • Frequency of use
  • Spatial consistency
  • Reduced motion

Animation performance

  • Frame rate (FPS)
  • Jank
  • GPU acceleration
  • will-change
  • Layout thrashing

Layout

  • Hero section
  • Above the fold
  • Sticky header
  • Sidebar
  • Bento grid
  • Card
  • Flexbox
  • CSS Grid
  • Padding vs margin
  • Responsive design
  • Container
  • Masonry layout
  • Split screen
  • Z-index
  • Overflow

Components

  • Button variants
  • Modal
  • Drawer
  • Popover
  • Tooltip
  • Dropdown menu
  • Context menu
  • Toast notification
  • Tabs
  • Segmented control
  • Accordion
  • Carousel
  • Command palette
  • Combobox
  • Toggle switch
  • Checkbox
  • Radio button
  • Date picker
  • Breadcrumb
  • Pagination
  • Infinite scroll
  • Badge
  • Avatar stack
  • Empty state
  • Skeleton screen
  • Spinner
  • Progress bar
  • Data table
  • Stepper
  • Floating label
  • Inline validation
  • Alert banner
  • Tag input

States & patterns

  • Interaction states
  • Focus ring
  • Loading state
  • Optimistic UI
  • Debounce
  • Lazy loading
  • Dark mode
  • Micro-interaction
  • Affordance
  • Undo
  • Drag and drop
  • Keyboard shortcut

Visual styles

  • Glassmorphism
  • Liquid glass
  • Neumorphism
  • Claymorphism
  • Neo-brutalism
  • Skeuomorphism
  • Flat design
  • Mesh gradient
  • Aurora background
  • Grain texture
  • Glow effect
  • Drop shadow
  • Border radius
  • Grid background
  • Typographic hierarchy
  • Accent color
  • Color contrast

Vibe coding & AI

  • Vibe coding
  • Prompt
  • Context window
  • Token
  • AI agent
  • Tool call
  • Hallucination
  • Diff
  • Live preview
  • Checkpoint
  • Git commit
  • Deploy
  • Frontend and backend
  • API
  • Database
  • Rules file
  • MCP
  • Plan mode
  • Visual edit
Engineering blog0%

How we cut our build times in half

Maya Chen · 4 min read

Our builds used to take eleven minutes. Every pull request waited in line, and people stopped running the full suite before merging.

We started by measuring. Half the time went to installing packages that had not changed since the last run.

Caching the package store cut four minutes on its own. Splitting the tests across four machines cut two more.

The last win was the smallest change: we stopped rebuilding images that only the release job needs.

Builds now finish in under five minutes, and the full suite runs on every pull request again.

Next, we want to run only the tests that a change can affect.