Skip to main content

Progress

Shows how far along a task is, as a bar or a ring.

import { Progress } from "@/fragments/ui";Source

Preview

<Progress value={60} label="Uploading…" showValue />

Installation

npx @usefragments/cli add progress

Writes src/fragments/ui/components/Progress plus what it imports, the globals stylesheet, and .fragments/registry-lock.json, then prints the packages to add. No account, no key.

Your own registry: publish from Fragments Cloud and add --registry org/name. Connect a workspace.

Anatomy

Progress is a compound: import the root and reach its parts through dot notation.

  • Progress.Circular

Examples

Tones

Colour carries state: normal, done, tight, critical.

import { Stack } from '@/components/Stack';

<Stack direction="column" gap="md">
  <Progress value={75} tone="accent" label="Processing" showValue />
  <Progress value={100} tone="success" label="Complete" showValue />
  <Progress value={80} tone="warning" label="Almost full" showValue />

Meter

A reading where hitting the top is not a win.

<Progress
  value={42}
  tone="neutral"
  role="meter"
  label="Seats used"
  showValue

Sizes

Thin for table rows, thick when the bar is the point.

import { Stack } from '@/components/Stack';

<Stack direction="column" gap="md">
  <Progress value={50} size="sm" label="Small" />
  <Progress value={50} size="md" label="Medium" />
  <Progress value={50} size="lg" label="Large" />

Indeterminate

value={null} sweeps instead of filling.

<Progress value={null} label="Loading…" />

Circular

Same value in a ring, for tiles and compact chrome.

import { CircularProgress } from '@/components/Progress';
import { Stack } from '@/components/Stack';

<Stack direction="row" gap="lg" align="center">
  <CircularProgress value={25} size="sm" />
  <CircularProgress value={50} size="md" showValue />

API

Component props
Prop
Type
Default
Description
valuenumbernullCurrent progress value (0-100). Null for indeterminate.
minnumber0Minimum value
maxnumber100Maximum value
sizeenumsmmdlgmdSize of the progress bar
toneenumaccentneutralsuccesswarningdangeraccentColour. accent is the plain bar; neutral reads as a meter whose maximum is not a success; success, warning and danger carry state.
labelstringNot setLabel text above the progress bar
showValuebooleanfalseShow percentage value
formatValuefunctionNot setCustom formatter for displayed progress value
roleunionNot set

Accessibility

  • Reports role="progressbar" with aria-valuenow
  • role="meter" is accepted for scalar readings inside a known range
  • The label is tied to the bar
  • Value changes are announced as they happen

Guidance

Use when

  • Upload and download progress
  • Percentage of a task finished
  • How much of a form is filled in
  • Waits where you know the duration

Avoid when

  • You cannot say how long — use Loading
  • Discrete steps — use a stepper
  • Status with no number — use Badge
  • BadgealternativeUse Badge for status without percentage
  • AlertsiblingUse Alert for completion messages

Next steps