Progress
A linear progress bar with determinate/indeterminate modes, color variants, striped animation, and optional labels.
Overview
The Progress component displays a linear progress bar for indicating completion or loading state. It supports determinate (known value) and indeterminate (unknown completion) modes, 6 color variants, 3 sizes, striped and animated styles, and optional labels with custom formatting.
Installation
Install the component via the CLI in one command.
npx @work-rjkashyap/unified-ui add progresspnpm dlx @work-rjkashyap/unified-ui add progressnpx @work-rjkashyap/unified-ui add progressbunx @work-rjkashyap/unified-ui add progressIf you haven't initialized your project yet, run npx @work-rjkashyap/unified-ui init first. See the CLI docs for details.
Or install the full package
Use this approach if you prefer to install the entire design system as a dependency instead of copying individual components.
npm install @work-rjkashyap/unified-uipnpm add @work-rjkashyap/unified-uiyarn add @work-rjkashyap/unified-uibun add @work-rjkashyap/unified-uiAnatomy
import { Progress } from "@work-rjkashyap/unified-ui";Examples
Basic Usage
Variants
Sizes
| Size | Height |
|---|---|
sm | 6px |
md | 8px |
lg | 12px |
With Label
Custom Format
The formatLabel prop accepts a function to display custom value formats. Since functions cannot be passed directly in MDX, here's the code pattern:
<Progress
value={750}
max={1000}
showLabel
label="Storage"
formatLabel={(v, m) => `${v}/${m} MB`}
/>
<Progress
value={8}
max={12}
showLabel
label="Files uploaded"
formatLabel={(v, m) => `${v} of ${m}`}
variant="info"
/>Indeterminate
Striped
Real-World Examples
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | 0 | Current progress value (0–100 by default). |
max | number | 100 | Maximum progress value. |
min | number | 0 | Minimum progress value. |
variant | "default" | "primary" | "success" | "danger" | "warning" | "info" | "default" | Color variant of the indicator bar. |
size | "sm" | "md" | "lg" | "md" | Height of the progress bar. |
indeterminate | boolean | false | Displays a looping animation for unknown progress. |
striped | boolean | false | Adds diagonal stripes to the indicator bar. |
animated | boolean | false | Animates the stripes (only applies when striped is true). |
showLabel | boolean | false | Shows a label row above the bar with text and value. |
label | ReactNode | — | Custom label text. Replaces default "X%" display. |
formatLabel | (value: number, max: number) => string | — | Custom format function for the progress value label. |
aria-label | string | — | Accessible label when no visible label is present. |
aria-labelledby | string | — | ID of the element that labels the progress bar. |
className | string | — | Additional CSS classes for the track (outer container). |
indicatorClassName | string | — | Additional CSS classes for the indicator (inner fill bar). |
Accessibility
When there is no visible label describing what the progress bar represents,
provide an aria-label (e.g. aria-label="Upload progress").
role="progressbar"— Proper semantic role for assistive technology.aria-valuenow— Set to the current value in determinate mode; omitted in indeterminate mode per WAI-ARIA spec.aria-valuemin/aria-valuemax— Always set to the min and max values.aria-label/aria-labelledby— Use to provide context when no visible label is present.- Indeterminate —
aria-valuenowis intentionally omitted so screen readers announce "progress busy" rather than a stale percentage.
Design Tokens
| Token | Usage |
|---|---|
--primary | Default / primary indicator color |
--success | Success variant indicator color |
--danger | Danger variant indicator color |
--warning | Warning variant indicator color |
--info | Info variant indicator color |
--muted | Track background color |
--radius-full | Rounded pill shape for track & fill |
--duration-standard | Width transition duration |
--easing-standard | Width transition easing |