Skip to content

Progress

Download .md

A progress bar shows how far a task of known length has come, such as uploading a master file.

  • Use it for uploads, imports and other tasks that report a percentage.
  • Use a Spinner when the length is unknown.
  • Always show a label above the bar, and the percentage when it helps.
React
Mengunggah master.wav
x
Vue
Mengunggah master.wav64%
1234
  1. 1Label
  2. 2Value
  3. 3Track
  4. 4Indicator

A label and an optional value above an 8px (h-2) pill track on muted, filled with primary up to the value.

There is one style.

React Vue Flutter Type Default Use
value model-value value (0 to 1) number React: none, which makes the bar indeterminate; Vue: 0 How far the task has come, 0 to 100 on the web.
ProgressLabel aria-labelledby on a visible label semanticsLabel text none Names the task.
ProgressValue text beside the label semanticsValue text none Shows the percentage.
import { Progress, ProgressLabel, ProgressValue } from "@/components/ui/progress"
export default function ProgressDemo() {
return (
<Progress value={64} className="w-full max-w-sm">
<ProgressLabel>Mengunggah master.wav</ProgressLabel>
<ProgressValue />
</Progress>
)
}
Terminal window
npx shadcn@latest add https://design.sosialoka.tech/r/react/progress.json
  • It has role="progressbar" with aria-valuenow, aria-valuemin and aria-valuemax.
  • Name it with its visible label.
  • Don’t announce every percent; say when the task is done, for example with a toast.