On this page

InstallationA value out of a totalLabelsPartsA change's added and removedVerticalAccessibilityAPI ReferenceRulesWritten down

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.

x
1<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%.

x
x
1<ProgressBar aria-label="Tokens used" value={120} max={250} color="info" />2<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.

Upload progress56%
x
1<ProgressBar2  label="Upload progress"3  valueLabel="56%"4  value={56}5  max={100}6  color="neutral"7/>

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.

x
1<ProgressBar2  size="lg"3  partTooltips4  parts={[5    { label: "Info", value: 48, color: "info" },6    { label: "Success", value: 30, color: "success" },7    { label: "Fail", value: 22, color: "error" },8  ]}9/>

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.

+29 −1
x
+4
x
+67
x
+1 −12
x
−8
x
1const fifths = progressBarFifths(29, 1); // { added: 4, removed: 1 }2 3<span className="inline-flex items-center gap-4">4  <span className="text-success-fg">+29</span> <span className="text-error-fg">−1</span>5  <ProgressBar size="sm" className="w-12" parts={[{ value: fifths.added, color: "success" }, { value: fifths.removed, color: "error" }]} />6</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.

x
x
1<ProgressBar aria-label="Tokens used" orientation="vertical" value={120} max={250} />2<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.

PropTypeDefaultDescription
valuenumber—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.
partTooltipsbooleanfalseOn a bar of parts, hovering the bar shows every part's label and numeric value.
maxnumber—What the value is out of. By default the value itself, so it fills the bar.
labelReactNode—Visible text before the bar. For a single-value bar, it also supplies the accessible name unless an ARIA name is passed.
valueLabelReactNode—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).

Catalog
Foundations
  • Overview
  • Tokens
  • Token usage
  • Typography
  • Icons
Atoms
  • Avatar
  • Badge
  • Button
  • Checkbox
  • Color picker
  • Copy button
  • Icon tooltip
  • Inline code
  • Input
  • Hint
  • Kbd
  • Loader
  • Native select
  • Progress bar
  • Progress ring
  • Radio
  • Select
  • Status dot
  • Switch
  • Text link
  • Textarea
  • Tooltip
  • Truncate
Molecules
  • Accordion
  • Activity chart
  • AI elements
  • Alert
  • Button group
  • Card
  • Code block
  • Combobox trigger
  • Command
  • Context switcher
  • Dropdown menu
  • Empty state
  • Field
  • Field group
  • Filter chip
  • Flow
  • Icon picker
  • Metric card
  • Modal
  • Modal confirmation
  • Pagination
  • Popover
  • Scroll area
  • Sidebar
  • Table
  • Tabs
  • Toggle group
LibraryPublished release