Keyframery

Progress

The bar fills on a spring, the percentage rolls and it turns green when complete.

See it as an AI agent does.

Resize preview. Focus the handle and use the left or right arrow keys. Hold Shift for larger steps.— px
Customize1 controls
Animation speed1×

Installation

npx shadcn@latest add @keyframery/progress

This 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
    └── ProgressIndicator

Examples

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

MoveWhat you see
SpringThe bar fills on a spring.
RollThe percentage rolls.
FadeIt 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.

VariableWhat it changesDefault
--progress-fillIn-progress fill--primary
--progress-trackTrack surface--muted
--progress-inkLabel and completed value--foreground
--progress-value-inkValue text--muted-foreground
--progress-completeCompleted filloklch(0.62 0.16 150)
--progress-heightTrack height0.375rem
--progress-radiusTrack and fill corners9999px
--progress-gapLabel to track gap0.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.

All components

On this page