Skip to main content

Circle Progress

The CircleProgress component displays a circular progress indicator with customizable size and percentage, built using SVG and Tailwind CSS.

import { CircleProgress } from "tawuniya/components";

👉 View in Storybook

Props​

PropTypeDefaultDescription
size"sm" | "md" | "lg" | "xl" | "xxl" | "xxxl""md"Controls the circle size (radius, text size, stroke width).
percentagenumber0The progress percentage (clamped between 0 and 100).
classNamestring-Additional Tailwind CSS classes for custom styling.

Size Configuration​

SizeRadiusText SizeSVG SizeStroke Width
sm128282
md1610363
lg2011444
xl2412525
xxl2814646
xxxl3216727

Usage​

export default function Example() {
return (
<div className="flex gap-6">
<CircleProgress size="md" percentage={45} />
<CircleProgress size="xl" percentage={80} className="text-green-500" />
<CircleProgress size="xxxl" percentage={100} />
</div>
);
}

Notes​

  • Progress percentage is automatically clamped between 0 and 100.
  • If percentage is less than 100, the progress stroke is given the text-primary color.
  • If percentage is 100, the progress stroke is given the text-success color.
  • The text inside the circle scales based on the size prop.