Skip to content

Stacked Progress

Coloured segments show a composition with a fine texture and a compact legend.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import StackedProgress from "./StackedProgress";
export default function Example() {
return (
<StackedProgress
items={[
{
"id": "design",
"label": "Design",
"value": 42,
"color": "#c1a6d6"
},
{
"id": "build",
"label": "Build",
"value": 28,
"color": "#7e9aa8"
},
{
"id": "review",
"label": "Review",
"value": 16,
"color": "#d7ae85"
}
]}
total={100}
label={"Project allocation"}
valueLabel={"86 / 100"}
height={42}
gap={6}
background={"#29222e"}
showLegend={true}
/>
);
}

Using Stacked Progress

Pass the segment values through items and set total for the scale they share. Use label and valueLabel to explain the displayed measure.

showLegend determines whether the segment names appear beneath the bar. Use onSegmentClick only when selecting a segment has a useful action.

Props

NameTypeRequiredDefaultDescription
itemsobject[]No[]Array of { id?, label, value, color? }. Negative and nonnumeric values occupy no width.
totalnumberNoundefinedCapacity; values larger than capacity expand the capacity to their sum.
labelstringNo""Optional visible heading and group label.
valueLabelstringNo""Optional caller-formatted value shown beside the heading.
heightnumber | stringNo38Bar height in pixels.
gapnumberNo5Gap between segments in pixels.
backgroundstringNo"#27222c"Unused capacity colour.
showLegendbooleanNotrueShow item labels and raw values beneath the bar.
onSegmentClickfunctionNoundefinedOptional callback (item, index); providing it makes each positive segment a keyboard-accessible button.
classNamestringNo""Additional CSS classes merged with the component styles.
styleCSSPropertiesNoundefinedInline styles for sizing, typography, and visual overrides.

Related components

Fine radial segments illuminate around a precise numeric readout.

Signal Bars

Feedback

Sculpted signal bars rise and fall in a staggered rhythmic wave.

A quiet spectrum of rounded bars rises and falls in a travelling rhythm.

Fluid Meter

Feedback

A circular gauge fills with two gently moving layers of liquid.