GooseUI

Components

Progress

New

Shows how far a task has gone. A server component with role="progressbar" and aria-valuenow, aria-valuemin and aria-valuemax, so screen readers announce the value, and the track and the bar stay fully styleable with tokens. Without a value the bar is indeterminate: aria-valuenow is left out and a stripe slides across the track.

Preview

Uploading photos0%

Installation

npx shadcn@latest add @gooseui/progress
pnpm dlx shadcn@latest add @gooseui/progress
yarn dlx shadcn@latest add @gooseui/progress
bunx --bun shadcn@latest add @gooseui/progress

Usage

import { Progress } from "@/components/ui/progress"

export default function Example() {
  return <Progress value={33} aria-label="Uploading photos" />
}

Examples

Indeterminate

Leave value out (or pass null) while the amount of work is unknown. With reduced motion the stripe is replaced by a slow pulse.

Connecting to the server
<Progress aria-label="Connecting to the server" />

Custom max and value text

max sets what complete means, here 5 steps. aria-valuetext gives screen readers a readable value instead of a number.

Profile setupStep 3 of 5
<Progress value={3} max={5} aria-label="Profile setup" aria-valuetext="Step 3 of 5" />

Size and color

className styles the track, indicatorClassName the filled part. Use tokens such as bg-destructive.

<Progress value={45} className="h-1" />
<Progress
  value={92}
  className="h-3 bg-destructive/20"
  indicatorClassName="bg-destructive"
/>

Props

PropTypeDefaultDescription
valuenumber | null-Current value from 0 to max. null or omitted makes the bar indeterminate
maxnumber100Value that means complete
indicatorClassNamestring-Classes for the filled part
classNamestring-Classes for the track: height, color, radius
aria-label / aria-valuetextstring-Give the bar a name with aria-label or aria-labelledby; aria-valuetext for a readable value

Features

  • Server component, no client JavaScript. Value changes animate with a CSS transition.
  • data-state is "indeterminate", "loading" or "complete"; data-value and data-max are set for styling.
  • Values outside 0…max are clamped.