Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Progress examples · With Label

With Count Progress for React

A progress bar for 7 of 10 tasks completed, with its label and the count above it.

Framework
UI library

A progress bar that counts items instead of percent: 7 of 10 tasks. A count reads more concretely than 70% for checklists, batches and steps.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

Where do 7 and 10 come from?

Two constants, COMPLETED and TOTAL, at the top of the file. Change them, or pass your own numbers, to move the bar and the text together.

How does the bar show 7 of 10?

Progress gets max 10 and value 7, and ProgressValue is a function that returns the value, of, and TOTAL.

What names the bar?

ProgressLabel does: the bar is announced as Tasks completed.

Does a screen reader hear 7 of 10?

It hears the value as a percent. Pass getAriaValueText to read 7 of 10 instead.

Why are the label and count above the track?

They are children of Progress, and the full-width track wraps below them. The value style's ml-auto puts the count at the end of the row.

How do I update the count?

Change COMPLETED as items finish.