Progress
The bar fills on a spring, the percentage rolls and it turns green when complete.
See it as an AI agent does.See this component the way an AI agent does.
Installation
npx shadcn@latest add @keyframery/progressThis adds components/keyframery/progress.tsx and its primitive to your project, and installs UI SDK. The motion tokens are added to your global CSS the first time you install a component.
Usage
import { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue } from "@/components/keyframery/progress"
export default function Usage() {
return (
<Progress value={40}>
<ProgressLabel>Uploading</ProgressLabel>
<ProgressValue />
<ProgressTrack>
<ProgressIndicator />
</ProgressTrack>
</Progress>
)
}Anatomy
How the parts fit together:
Progress
├── ProgressLabel
├── ProgressValue
└── ProgressTrack
└── ProgressIndicatorExamples
Basic
The bar eases to each new value, and the number rolls with it.
Indeterminate
value={null} when you can't tell how long it will take. The bar sweeps until a value arrives.
Motion
| Move | What you see |
|---|---|
| Spring | The bar fills on a spring. |
| Roll | The percentage rolls. |
| Fade | It turns green when complete. |
Timing and springiness follow the motion style you set. To change how fast this progress moves, pass speed:
<Progress speed="fast">
…
</Progress>"fast" is 0.6×, "slow" 1.4×, and a number sets the multiplier. With reduced motion turned on, nothing moves: changes happen at once or with a short fade.
Theming
Set these CSS variables on the component or a parent. Leave them unset to follow the light and dark theme. The open Customize panel below the preview lets you try these settings.
| Variable | What it changes | Default |
|---|---|---|
--progress-fill | In-progress fill | --primary |
--progress-track | Track surface | --muted |
--progress-ink | Label and completed value | --foreground |
--progress-value-ink | Value text | --muted-foreground |
--progress-complete | Completed fill | oklch(0.62 0.16 150) |
--progress-height | Track height | 0.375rem |
--progress-radius | Track and fill corners | 9999px |
--progress-gap | Label to track gap | 0.5rem |
API reference
Every part takes className and children. Parts from UI SDK also take render, to draw your own element, and a function of their state for className and style. Props not listed here are in the UI SDK progress reference.
Progress
Renders a <div>, and takes its props too.
Prop
Type
Roll
Prop
Type
Other parts
These take the props of the element they render, and nothing else:
ProgressLabel: a<span>ProgressValue: a<span>ProgressTrack: a<div>ProgressIndicator: a<div>
Accessibility
Keyboard, focus and screen-reader behaviour come from UI SDK and are not changed. More in Accessibility.
Swap the import
Already using UI SDK's progress with your own styles? Keep your markup and change one line. The primitive adds motion and nothing else.
// Before
import { … } from "@ui-sdk/react/progress"
// After: same parts, same props, now animated
import { … } from "@/components/keyframery/primitives/progress"Questions
How does the animated Progress for UI SDK move?
Spring: The bar fills on a spring. Roll: The percentage rolls. Fade: It turns green when complete.
Do I need Motion or Framer Motion for the animated Progress?
No. Every move is plain CSS, so there is nothing to install besides the component and UI SDK.
Can I keep my own styling and only take the motion?
Yes. Import from @/components/keyframery/primitives/progress instead. It has the same parts and props as @ui-sdk/react/progress and adds motion only.
What happens to the Progress when someone turns on reduced motion?
Nothing moves. State changes happen at once, or with a short fade.