Skip to Content
zjkm-ui
Components

Progress Bar

A bar that fills smoothly to its value.

Props
64
<ProgressBar label="Uploading report.pdf" value={64} />

Installation

npx shadcn@latest add https://ui.zjkm.tech/r/progress-bar.json
import { ProgressBar } from "@/components/progress-bar"

Using JavaScript? Set tsx: false in components.json and the CLI converts it.

New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.

Usage

A labelled bar that glides to each new value, with the percentage beside the label. It's a progressbar with its value, so screen readers can report it.

import { ProgressBar } from "@/components/progress-bar";

export function Upload({ sent, size }: { sent: number; size: number }) {
  return <ProgressBar label="Uploading report.pdf" value={sent} max={size} />;
}

Props

PropTypeDefaultDescription
valuenumberProgress so far.
maxnumber100The total.
labelstringAccessible name, also shown.
showValuebooleantrueShows the percentage.
colorstring"#6366f1"Fill colour.
classNamestringClasses for the wrapper.

With reduced motion, the bar jumps to each value.

On this page