Figma UI kit
Domain and AI

Progress bars

v1.2.1

Show how far along work is.

Quick usage

Import the shared component; never copy its markup into a feature. The Web TSX tab beside the live stage has a complete, working example.

import ProgressBar from '@/shared/components/ProgressBar';

Live stage and code

The live component and its controls on the left, the code on the right; change a control and the code follows: Web TSX (the component in a working example), Tailwind and HTML (the markup it renders, with its data attributes), React Native, SwiftUI and Jetpack Compose. The header theme switch drives every stage.

Props

Read from the component's source when the docs build: names and defaults from its signature, types and descriptions from its JSDoc. A blank type means the prop has no JSDoc yet.

PropTypeDefaultDescription
valuenumber0-
maxnumber100-
tone'primary'|'in-progress'|'success'|'warning'|'error'|'info''primary''in-progress' is the Gantt's --bar-in-progress, for work under way.
size'sm'|'md''md'md is 6px; sm is 4px, for a bar inside a dense row or a popover line where 6px would outweigh the text beside it.
segments-null-
labelstring-Accessible name ("Weld progress").
showValuebooleanfalsePrint the percentage beside the bar.

Source: frontend/src/shared/components/ProgressBar/ProgressBar.js

DOM contract

What the rendered element carries: the data attributes its styles key on, its roles and ARIA, its focus style, and whether its stylesheet draws the 44px hit boundary. Also read from the source.

Data attributesdata-dsdata-sizedata-tone
Rolesrole="progressbar"
ARIAaria-labelaria-valuemaxaria-valueminaria-valuenow
FocusNo :focus-visible rule of its own
44px hit boundaryNot a pressable root

Accessibility and touch

Passive.

Progress bars is passive: it reports a condition and is not pressed, so it has no hit boundary. If a design makes it pressable, it gains the 44 by 44 boundary and is marked /* ds-chip: why */.

Rules and constraints

Use it for

  • Task and job progress, receiving completion.

Avoid

  • Never a bar without the figure beside it: a bar alone cannot be read exactly.

Constraints

  • The track is --bg-active; the fill takes the status hue; figures in tabular numerals.

More in Domain and AI