Progress bar
One value out of a total, on a tint of its own color; or two or three parts that fill the bar, optionally with a label row.
<ProgressBar aria-label="Probes graded" value={62} max={100} />Installation
import { ProgressBar } from "@catalog-dashboard/components";
import { progressBarFifths } from "@catalog-dashboard/lib/progress-bar";A value out of a total
One value out of max: a fill rounded at both ends, on a track of its own color at 35%.
<ProgressBar aria-label="Tokens used" value={120} max={250} color="info" /><ProgressBar aria-label="Tokens used" value={250} max={250} color="error" />Labels
A label row sits 8px above a horizontal bar: its label starts at the bar's edge and its value aligns at the far edge. A single-value bar takes its accessible name from label when no ARIA name is supplied.
<ProgressBar label="Upload progress" valueLabel="56%" value={56} max={100} color="neutral"/>Parts
Two or three parts, side by side in order, in success, error or info: 1px apart at sm and md, 2px at lg and xl. A part above zero is never shorter than 4px, so a tiny one still shows; the largest part gives up the room, and a part at zero is not drawn. They always fill the whole bar, with no track, so the bar stays unnamed: its numbers go beside it. Set partTooltips to show every part's label and value on hover.
<ProgressBar size="lg" partTooltips parts={[ { label: "Info", value: 48, color: "info" }, { label: "Success", value: 30, color: "success" }, { label: "Fail", value: 22, color: "error" }, ]}/>A change's added and removed
size="sm", 48px long, the one width of a bar in a table cell (the Table draws it as TableBar), its parts in fifths (progressBarFifths): added, then removed, 16px after the numbers. A change all one way is one part. Unnamed, it is decoration: the numbers say the same.
const fifths = progressBarFifths(29, 1); // { added: 4, removed: 1 } <span className="inline-flex items-center gap-4"> <span className="text-success-fg">+29</span> <span className="text-error-fg">−1</span> <ProgressBar size="sm" className="w-12" parts={[{ value: fifths.added, color: "success" }, { value: fifths.removed, color: "error" }]} /></span>Vertical
orientation="vertical" stands it upright, as tall as what holds it: one value fills from the bottom up, and parts stack from the bottom up in the order they read left to right.
<ProgressBar aria-label="Tokens used" orientation="vertical" value={120} max={250} /><ProgressBar orientation="vertical" parts={[{ value: 48, color: "info" }, { value: 30, color: "success" }, { value: 22, color: "error" }]} />Accessibility
Named with aria-label, it is a progressbar: a screen reader hears its name and how far along it is. Unnamed, it is decoration (aria-hidden), for numbers beside it that say the same. Parts always fill the bar, so a screen reader would only hear 100%: leave a bar of parts unnamed, with its numbers beside it.
API Reference
Besides these, the props of Base UI's Progress.Root.
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | One part's value. |
color | "neutral" | "primary" | "success" | "warning" | "error" | "info" | "fuchsia" | "info" | The value's color, and its track's at 35%. |
parts | [part, part] | [part, part, part], each { label?: ReactNode; value: number; color?: "success" | "error" | "info" } | — | Two or three parts in place of a value; they always fill the bar. |
partTooltips | boolean | false | On a bar of parts, hovering the bar shows every part's label and numeric value. |
max | number | — | What the value is out of. By default the value itself, so it fills the bar. |
label | ReactNode | — | Visible text before the bar. For a single-value bar, it also supplies the accessible name unless an ARIA name is passed. |
valueLabel | ReactNode | — | Visible value aligned at the label row's far edge, such as 56% or 631 / 10,000. |
size | "sm" | "md" | "lg" | "xl" | "md" | Its thickness: 4, 6, 8 or 12px, the height lying down and the width standing up. Its length is what holds it. On a bar of parts it also sets their gap: 1px at sm and md, 2px at lg and xl. |
orientation | "horizontal" | "vertical" | "horizontal" | Vertical fills from the bottom up. |
Rules
Written down
Known progress is a bar that fills
A wait with no known end is the Loader; known progress is this bar.
From .claude/rules/dashboard-ui.md (rule 6).
Colors are its own
A value's color is one of seven names, each the bar's own token, its track the same color at 35%. Parts take success, error or info. Never a raw color.
From ds/README.md (Progress bar) and ds/tokens/progress-bar.css.
Parts fill the bar
Two or three parts always make the whole bar: no track behind them, no max.
From ds/README.md (Progress bar) and ds/components/progress-bar.tsx.
A change: in fifths, 16px after the numbers
The +/− of a change is size="sm" with its parts in fifths (progressBarFifths), added then removed, 16px after its numbers (gap-4).
From ds/README.md (Progress bar).