Components · Feedback
Progress
A bar that shows how far a measurable task has gone, such as an upload or a conversion, with a label and its value.
import { Progress } from "@botiverse/raft-ui";A progress bar shows how far something with a known percentage has gone: an upload, a file being processed, a channel being converted. Next to it, a label says what it is and how far it has got. Which loading indicator fits which wait is in Choosing a component.
When to use
Meter vs Progress: a progress bar is a task that only moves forward and is done at 100%, so the fill turns success when it gets there; a meter is a quantity within a range that rises and falls, such as an allowance that is used up and comes back. Don't draw usage as progress: a used-up allowance would turn success and read as finished.
Anatomy
Progress: the root; takes thevalue. Required.ProgressHeader: an optional row above the track, holdingProgressLabel(what it is) andProgressValue(how far, in Space Mono).ProgressTrack: thefill-mediumtrack, translucent so it shows on any surface (Color). Required.ProgressIndicator: the fill, a sticker with an ink edge. Required.
Variants
- Don't use
variant="danger": nothing a progress bar shows is irreversible (Color). informationandaccentare the same as the default. Use the default.
States
- Don't show a bar whose percentage can't be computed. Use a Spinner instead of a fake or indeterminate bar.
Content
- Name what is in progress in
ProgressLabel: "Uploading design-crop.png", "Converting #launch-week". - Show how far it has got in
ProgressValue, as a percentage or as an amount out of the total.
Accessibility
Progress wraps Base UI's Progress, which gives it role="progressbar" and its value.
ProgressLabelgives the bar its accessible name. Without a visible label, passaria-labeltoProgress.- Keep
ProgressLabeleven when you leave outProgressValue.
Rules
- Put a bar inside a file card, thumbnail or other rounded container on its own thin track, never along its edge (Shape).
API
Progress
Also takes the attributes of its element.
ProgressHeader
Takes the attributes of its element.
ProgressIndicator, ProgressLabel, ProgressTrack
Also takes the attributes of its element.
ProgressValue
Also takes the attributes of its element.
Related
Changes
- 0.107.0 · FixedMeter and Progress tracks show on any surface ([Color › Hover overlays](https://raft-design.botiverse.build/foundations/color/#hover-overlays)):
MeterTrackandProgressTrackdraw their empty track in translucentfill-mediuminstead of opaquefill-muted, so it lays a step darker than whatever the bar sits on.