bx

Progress

Displays an indicator showing the completion progress of a task.

tsx
<div className="w-full max-w-md space-y-4">
  {[0, 33, 66, 100].map((v) => (
    <Progress key={v} value={v} ariaLabel={"Progress, step " + v} />
  ))}
</div>

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

Terminal
$ bext ui add progress

Usage

tsx
import { Progress } from "@bext-stack/ui/primitives"

<Progress value={60} ariaLabel="Upload" />

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.

Try it live Open in play

Edit this example live in the bext playground. It compiles and runs entirely in your browser.

src/app/page.tsx 1 file · react · runs in your browser
The React idiom: same UI, for comparison.