docs / patterns / progress-row
ProgressRow
a labelled progress bar with a value-over-max figure. the bar color keys the row to a category, and any verdict goes in the status slot.
intensity · structuresrsc · client
provenance
shaped from sisu-pluslayer
core / patternsintensity
structures · organizes a region, stays out of the contentcomposition
stack inside a Card body with divide-y for a module lista Badge in the status slot when a row needs a verdictnot a disclosure. no chevron, no aria-expanded, no wrapping buttonno traffic-light barColor. status has its own slota11y
role="progressbar" with aria-valuenow/min/max · a string label becomes the bar's aria-label, pass one yourself otherwisejest-axelive demo · try it out
Computer Science
In progress
12 / 30 cr
customize
labelthe row's name
valuecurrent amount
maxtarget amount
unittrailing figure unit
barColorcategorical key color, not a verdict
statusa slot, usually a Badge
usage
import { ProgressRow } from "@usva-ui/react/patterns/progress-row";
import { Badge } from "@usva-ui/react/primitives/badge";
<ProgressRow
label="Computer Science"
value={12}
max={30}
unit="cr"
barColor="#8b5cf6"
status={<Badge tone="warning">In progress</Badge>}
/>props
| prop | type | default | notes |
|---|---|---|---|
| label | ReactNode | — | the row's name. doubles as the bar's accessible name when a string. |
| value | number | — | current amount. clamped, overshoot fills the bar. |
| max | number | — | target amount. a max of 0 renders an empty bar, not a division by zero. |
| unit | string | — | trailing unit on the figures, e.g. "cr". |
| status | ReactNode | — | a slot, usually a Badge. never derived from the ratio. |
| barColor | string | — | categorical key color, any CSS color. it says which row this is, not how it is doing. |
get it
bun add @usva-ui/reactusage
import { ProgressRow } from "@usva-ui/react/patterns/progress-row";
import { Badge } from "@usva-ui/react/primitives/badge";
<ProgressRow
label="Computer Science"
value={12}
max={30}
unit="cr"
barColor="#8b5cf6"
status={<Badge tone="warning">In progress</Badge>}
/>