Progress
Shows how far a task has got. Determinate when you know the value, indeterminate when you do not. The label and value text sit inside the progressbar element, so assistive technology reads them together.
Installation
Add Progress to your project with the CK-UI CLI. It copies the source into your project, so the code is yours to change.
- Adds
Progress.tsxto your CK-UI folder (src/components/ck-ui by default)- Installs
- No extra npm packages
First time with CK-UI in this project? Run npx ck-ui-cli@latest init once before adding components. The installation guide explains what it sets up.
Manual installationInstall the packages and copy the files yourself.
Create or update your Progress component
Copy this code to create your Progress component
Test Your Component
- 1. Add the component to a test page
- 2. Check all props and variants work as expected
- 3. Verify responsive behavior
- 4. Test with different content/data
- 5. Ensure accessibility features work correctly
Upload
Update value as the task advances; switch color when it completes.
Installation Steps
Use max for counts and getValueLabel for the text ("Step 2 of 5"). A bar without a value is indeterminate.
Storage
Custom ranges and intent colors for usage meters.
Indeterminate
Leave value out (or pass null) when progress cannot be measured. Root renders the track and indicator when it has no children.
Colors and Sizes
Accessibility
Progress.Roothasrole="progressbar"witharia-valuemin,aria-valuemax,aria-valuenowandaria-valuetext(from getValueLabel).- Indeterminate bars omit aria-valuenow and aria-valuetext, which tells assistive technology the value is unknown.
- Every bar needs a name: a
Progress.Label(wired with aria-labelledby) or anaria-label. - Values outside min–max are clamped; a non-numeric value is treated as indeterminate.
- Fills use contrast-safe tokens (at least 3:1 against the track in both themes). The indeterminate animation stops under reduced motion and becomes a still segment.
- The bar grows with width, so it fills from the right in right-to-left layouts.
API Reference
Import with import * as Progress from "@/components/ui/Progress".
Progress.Root
The progressbar element. Wraps the label, value and track.
| Prop | Type | Default | Description |
|---|---|---|---|
value | "number | null" | "undefined" | Current value. null or undefined → indeterminate. Clamped to min–max. |
min | "number" | "0" | Lowest value. |
max | "number" | "100" | Highest value. Must be greater than min (falls back to min + 100). |
getValueLabel | "(value, { min, max, percentage }) => string" | "rounded %" | Text for aria-valuetext and Progress.Value. A function, so set it from a client component. |
color | "primary""success""warning""destructive" | "primary" | Fill color. |
size | "sm""md""lg" | "md" | Track height: 4, 8 or 12px. |
aria-label | "string" | "undefined" | Name the bar when there is no Progress.Label. |
className | "string" | "undefined" | Additional classes, merged last. |
Progress.Label
Names the progressbar.
| Prop | Type | Default | Description |
|---|---|---|---|
className | "string" | "undefined" | Additional classes, merged last. |
Progress.Value
Visible value text (aria-hidden, since the progressbar already exposes it). Renders nothing while indeterminate unless you pass children.
| Prop | Type | Default | Description |
|---|---|---|---|
className | "string" | "undefined" | Additional classes, merged last. |
Progress.Track
The rail.
| Prop | Type | Default | Description |
|---|---|---|---|
className | "string" | "undefined" | Additional classes, merged last. |
Progress.Indicator
The fill, sized from the value.
| Prop | Type | Default | Description |
|---|---|---|---|
className | "string" | "undefined" | Additional classes, merged last. |
Used in these blocks
Block families with at least one block built on this component. Each page previews its blocks and lists the components and packages they use.