A progress bar whose width settles on a soft spring without overshoot.
Installation
Install the packages
npm install @prequelui/react motion@prequelui/react reuses the primitive library your components already depend on.
Add the component
npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/progress.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/progress.json
Turn on the motion
npx @prequelui/cli@latest animate progressThe 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.
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.
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
| Prop | Type | Default |
|---|---|---|
| value | number | 0 |
| max | number | 100 |
| indicatorClassName | string | — |
| transition | Transition | component spring or tween |
| className | string | — |