Skip to main content
The Progress component displays a horizontal progress bar that can be used to show task completion, loading states, or any measured progress.

Installation

npx shadcn@latest add @eo-n/progress

Usage

import { Progress } from "@/components/ui/progress";
<Progress value={56} />

Examples

Basic Progress

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

export default function Example() {
  const [value, setValue] = React.useState(0);

  React.useEffect(() => {
    const interval = setInterval(() => {
      setValue((current) => Math.min(100, current + 10));
    }, 500);
    return () => clearInterval(interval);
  }, []);

  return <Progress value={value} className="w-80" />;
}

With Label

import { Progress, ProgressLabel } from "@/components/ui/progress";

<Progress value={45}>
  <ProgressLabel>Uploading...</ProgressLabel>
</Progress>

With Value Display

import { Progress, ProgressLabel, ProgressValue } from "@/components/ui/progress";

<Progress value={67}>
  <ProgressLabel>Installation Progress</ProgressLabel>
  <ProgressValue />
</Progress>

Controlled Progress

import { useState, useEffect } from "react";
import { Progress, ProgressLabel, ProgressValue } from "@/components/ui/progress";

export default function ControlledProgress() {
  const [progress, setProgress] = useState(0);

  useEffect(() => {
    const timer = setInterval(() => {
      setProgress((prev) => {
        if (prev >= 100) {
          clearInterval(timer);
          return 100;
        }
        return prev + 5;
      });
    }, 200);

    return () => clearInterval(timer);
  }, []);

  return (
    <Progress value={progress}>
      <ProgressLabel>Processing</ProgressLabel>
      <ProgressValue />
    </Progress>
  );
}

Indeterminate State

<Progress value={null}>
  <ProgressLabel>Loading...</ProgressLabel>
</Progress>

Component API

Progress

The root container component.
value
number | null
required
The current progress value (0-100). Pass null for an indeterminate state.
max
number
The maximum value. Defaults to 100.
className
string
Additional CSS classes to apply to the root element.
children
React.ReactNode
Optional label and value components.

ProgressLabel

Displays a label for the progress bar.
children
React.ReactNode
required
The label text.
className
string
Additional CSS classes.

ProgressValue

Displays the current progress value as text.
className
string
Additional CSS classes.
format
(value: number, max: number) => string
Custom formatter for the value display. Defaults to showing percentage.

Accessibility

The Progress component is built on Base UI and includes:
  • Proper ARIA attributes (role="progressbar", aria-valuenow, aria-valuemin, aria-valuemax)
  • Screen reader announcements for value changes
  • Support for indeterminate states

Reference

Built on top of Base UI Progress.

Build docs developers (and LLMs) love