Docs
Circular Progress

Circular Progress

Displays an ongoing process or activity in a circular format.

45%
With Text
Without Text

Installation

Usage

import { CircularProgress } from "@/components/ui/circular-progress";
<CircularProgress value={75} />

Examples

Basic

45%
With Text
Without Text

Without Text

You can hide the percentage text by using the hideText prop:

<CircularProgress value={75} hideText />

Custom Stroke Width

You can customize the thickness of the progress ring:

<CircularProgress value={75} strokeWidth={8} />

Dynamic Progress

You can update the value programmatically to show progress:

const [progress, setProgress] = useState(0);
 
useEffect(() => {
  const timer = setInterval(() => {
    setProgress((prevProgress) => {
      const newProgress = prevProgress + 5;
      if (newProgress >= 100) {
        clearInterval(timer);
        return 100;
      }
      return newProgress;
    });
  }, 500);
 
  return () => {
    clearInterval(timer);
  };
}, []);
 
return <CircularProgress value={progress} />;

Props

PropTypeDefaultDescription
valuenumber-The progress value (0-100)
strokeWidthnumber4The width of the progress circle stroke
hideTextbooleanfalseWhether to hide the percentage text
classNamestring-Additional CSS class name