Progress

A progress bar whose width settles on a soft spring without overshoot.

progress.tsx

Installation

1

Install the packages

npm install @prequelui/react motion

@prequelui/react reuses the primitive library your components already depend on.

2

Add the component

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/progress.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/progress.json

3

Turn on the motion

npx @prequelui/cli@latest animate progress

The CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.

Usage

Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.

progress.tsx
import { Progress } from "@/components/prequelui/progress";

export default function Demo() {
  return <Progress value={64} className="w-[360px]" />;
}
import { Progress } from "@/components/prequelui/progress";

export function Variant() {
  return (
    <Progress tempo={1.2}>
      …
    </Progress>
  );
}

Animation

The bar never jumps between values. Each new value retargets the same width spring, which is damped just enough to settle without a visible overshoot, even when the value moves backwards.

  • Width spring: 300 / 35, restDelta 0.01, restSpeed 0.1.
  • Retargeting keeps the current velocity instead of restarting.
  • The track colour is static; only the indicator changes width.
  • Reduced motion writes the new width immediately.
spring 300 / 35restDelta 0.01no overshootretargetable

API Reference

Every part takes exactly the props of the Progress primitive. The animated surface adds only motion props, so the accessibility tree and keyboard behaviour stay the same.

Progress

PropTypeDefault
valuenumber0
maxnumber100
indicatorClassNamestring—
transitionTransitioncomponent spring or tween
classNamestring—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026