Overview
The ProgressCircle component displays progress as a circular indicator. Based on Tremor’s ProgressCircle component, it supports multiple color variants and customizable sizing.Import
ProgressCircle
Circular progress indicator with customizable appearance and animation.Props
Current progress value. Will be clamped between 0 and
max.Maximum value for the progress. The progress percentage is calculated as
(value / max) * 100.The color variant of the progress circle:
default: Primary color strokeneutral: Gray stroke for neutral statesblue: Blue stroke for informational progresswarning: Warning/yellow color for cautionary stateserror: Destructive/red color for error statessuccess: Primary/green color for success states
The radius of the circle in pixels. Total width/height will be
radius * 2.The width of the progress stroke in pixels.
Whether to animate progress changes. When true, progress updates transition smoothly over 300ms.
Additional CSS classes to apply to the SVG element.
Optional content to display in the center of the circle (e.g., percentage text, icons).
Ref object to attach to the underlying SVG element.
SVG Props
ExtendsOmit<React.SVGProps<SVGSVGElement>, 'value'>, inheriting all standard SVG attributes except value:
styleonClickonMouseEnter- etc.
Usage
Accessibility
- Uses proper ARIA attributes:
role="progressbar"aria-label="Progress circle"aria-valuenow={value}aria-valuemin={0}aria-valuemax={max}
- Includes data attributes for value and max:
data-value={safeValue}data-max={max}
Styling
The component uses Tailwind Variants for styling with the following structure:Background Circle
A lighter stroke representing the total progress range (30-40% opacity of the variant color).Progress Circle
The filled portion representing current progress:- Smooth color transitions
- Optional 300ms ease-in-out animation
- Round stroke line caps
- Automatically calculated stroke-dashoffset based on progress percentage
Center Content
Absolutely positioned container for children:- Centered horizontally and vertically
- Does not affect circle rendering
- Useful for percentage labels or status icons
Variant Colors
default: Primary color (stroke-primarywithstroke-primary/30background)neutral: Gray (stroke-gray-500withstroke-gray-200background)blue: Info color (stroke-infowithstroke-info/40background)warning: Warning color (stroke-warningwithstroke-warning/30background)error: Destructive color (stroke-destructivewithstroke-destructive/30background)success: Primary color (same as default)