Progress
Determinate progress bar with an accessible value readout.
import { Progress } from '@elirobinson/react/components/atoms/Progress';Styles: @elirobinson/react/styles/atoms/Progress.css — already included when you import @elirobinson/react/styles.css.
Show code
import { Progress } from '@elirobinson/react/components/atoms/Progress';
export default function Basic() {
return (
<div className="demo-col">
<Progress value={65} label="Import progress" />
</div>
);
}When to use it
Use Progress when you know how far along a task is — an upload, an import, a
multi-step count. Use Spinner instead for indeterminate work where you don't know how
long it'll take, and Skeleton for a structural loading placeholder before content
exists at all.
Values and custom max
value clamps to the 0–max range for you. Use max to represent the real unit
instead of normalizing everything to a percentage yourself.
Show code
import { Progress } from '@elirobinson/react/components/atoms/Progress';
export default function States() {
return (
<div className="demo-col">
<Progress value={20} label="Warm-up drills" />
<Progress value={65} label="Skills circuit" />
<Progress value={100} label="Cooldown" />
<Progress value={3} max={5} label="Modules complete" />
</div>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
valuerequired | number | — | — |
label | string | — | — |
max | number | 100 | — |
Also accepts all HTMLAttributes<HTMLDivElement> props.
Accessibility
- Renders
role="progressbar"witharia-valuenow,aria-valuemin={0}, andaria-valuemaxkept in sync withvalue/max. labelbecomes the progress bar'saria-label— it's optional in the type, but it's the only accessible name the control gets. Skip it and screen readers announce an unlabeled progress bar.- No internal timer or animation — the visual bar only moves when
valuechanges, so the state you show is always the state you pass in.
Do
- Always pass label — it’s optional in the type but it’s the only accessible name the progress bar gets.
- Use max to represent the real unit ("modules complete", "MB uploaded") instead of pre-converting to a percentage.
- Update value from state you already have — Progress has no internal timer of its own.
Don't
- Use Progress for a task with no known duration or endpoint — use Spinner instead.
- Omit label and rely on nearby text to carry meaning — screen readers read the progress bar in isolation.
- Animate value with a fake setInterval — if the real progress is unknown, don’t simulate one.