Command Palette

Search for a command to run...

Progress

Displays an indicator showing the completion progress of a task.

Installation

npm i @radix-ui/react-progress

Usage

1 2 3 4 5 6 7 8 9 10 11 12 13 import * as React from "react" import { Progress } from "@/components/ui/progress" export function ProgressDemo() { const [progress, setProgress] = React.useState(13) React.useEffect(() => { const timer = setTimeout(() => setProgress(66), 500) return () => clearTimeout(timer) }, []) return <Progress value={progress} className="w-[60%]" /> }

Examples

Custom Colors

Default

Blue

Red

Green

Different Sizes

Small (h-2)

Default (h-4)

Large (h-6)

Extra Large (h-8)

Indeterminate

Loading State

Props

NameTypeDescription
valuenumberThe value of the progress indicator (0-100). Omit to make the progress indeterminate.
classNamestringAdditional CSS classes for the root element.
indicatorClassNamestringAdditional CSS classes for the indicator element.
maxnumberThe maximum value for the progress indicator (defaults to 100).
...restProgressPrimitive.ProgressPropsOther props passed to the Radix UI Progress component.

Accessibility

The Progress component adheres to the WAI-ARIA meter pattern.

KeyDescription
roleAutomatically set to progressbar
aria-valueminSet to 0
aria-valuemaxSet to the max value (default 100)
aria-valuenowSet to the current value (or removed when indeterminate)
aria-valuetextOptional text representation of the value