Unified UI

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 progress
pnpm dlx @work-rjkashyap/unified-ui add progress
npx @work-rjkashyap/unified-ui add progress
bunx @work-rjkashyap/unified-ui add progress

If 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-ui
pnpm add @work-rjkashyap/unified-ui
yarn add @work-rjkashyap/unified-ui
bun add @work-rjkashyap/unified-ui

Anatomy

import { Progress } from "@work-rjkashyap/unified-ui";

Examples

Basic Usage

Variants

Default
Primary
Success
Warning
Danger
Info

Sizes

Small (6px)
Medium (8px, default)
Large (12px)
SizeHeight
sm6px
md8px
lg12px

With Label

45%
72%
Uploading files...30%
Storage used92%

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"
/>
Storage75%
Files uploaded67%

Indeterminate

Striped

Striped
Striped + Animated
Striped + Success
Striped + Warning

Real-World Examples

Profile completion6 of 8 steps
Storage used92%
4.6 GB of 5 GB used. Upgrade your plan for more storage.
Uploading 3 files...

Props

PropTypeDefaultDescription
valuenumber0Current progress value (0–100 by default).
maxnumber100Maximum progress value.
minnumber0Minimum 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.
indeterminatebooleanfalseDisplays a looping animation for unknown progress.
stripedbooleanfalseAdds diagonal stripes to the indicator bar.
animatedbooleanfalseAnimates the stripes (only applies when striped is true).
showLabelbooleanfalseShows a label row above the bar with text and value.
labelReactNodeCustom label text. Replaces default "X%" display.
formatLabel(value: number, max: number) => stringCustom format function for the progress value label.
aria-labelstringAccessible label when no visible label is present.
aria-labelledbystringID of the element that labels the progress bar.
classNamestringAdditional CSS classes for the track (outer container).
indicatorClassNamestringAdditional 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.
  • Indeterminatearia-valuenow is intentionally omitted so screen readers announce "progress busy" rather than a stale percentage.

Design Tokens

TokenUsage
--primaryDefault / primary indicator color
--successSuccess variant indicator color
--dangerDanger variant indicator color
--warningWarning variant indicator color
--infoInfo variant indicator color
--mutedTrack background color
--radius-fullRounded pill shape for track & fill
--duration-standardWidth transition duration
--easing-standardWidth transition easing

On this page