Progress
Displays an indicator showing the completion progress of a task.
Progress is a horizontal bar that shows progress from 0 to max (100 by default). Useful for uploads, installs and batch operations. Without a value it is indeterminate for assistive technologies, but the bar stays empty: for a visible "in progress" state, prefer Spinner.
Installation
$ bext ui add progress
Copy and paste the following into src/components/ui/progress.tsx.
Usage
Anatomy
<Progress value={60} ariaLabel="Upload" /> // value: 0 to max (100)API Reference
Progress
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | — | Current value, from 0 to max; values outside the range are clamped. Written to aria-valuenow. When omitted, aria-valuenow is left out (indeterminate) and the bar is empty. |
| max | number | 100 | Value that fills the bar. Written to aria-valuemax. |
| ariaLabel | string | — | Accessible name of the progress bar (aria-label). Set it: a progressbar needs a name. |
| className | string | — | Extra classes on the track (h-2 w-full rounded-full by default). |
Accessibility
The track sets role="progressbar", aria-valuemin="0", aria-valuemax (the max prop) and aria-valuenow (the clamped value). When value is omitted, aria-valuenow is left out, which assistive technologies read as indeterminate.
A progress bar needs an accessible name: pass ariaLabel. There is no prop for aria-labelledby or aria-valuetext.
Edit this example live in the bext playground. It compiles and runs entirely in your browser.
On This Page