Getting Started
Blocks
Components
Device Mocks
Special Effects
Animations
Text Animations
Buttons
0
"use client";
import { useEffect, useState } from "react";
import { AnimatedCircularProgressBar } from "@/registry/magicui/animated-circular-progress-bar";
export function AnimatedCircularProgressBarDemo() {
const [value, setValue] = useState(0);
useEffect(() => {
const handleIncrement = (prev: number) => {
if (prev === 100) {
return 0;
}
return prev + 10;
};
setValue(handleIncrement);
const interval = setInterval(() => setValue(handleIncrement), 2000);
return () => clearInterval(interval);
}, []);
return (
<AnimatedCircularProgressBar
value={value}
gaugePrimaryColor="rgb(79 70 229)"
gaugeSecondaryColor="rgba(0, 0, 0, 0.1)"
/>
);
}
Installation
pnpm dlx shadcn@latest add @magicui/animated-circular-progress-bar
Usage
import { AnimatedCircularProgressBar } from "@/components/magicui/animated-circular-progress-bar";
<AnimatedCircularProgressBar />
Props
Prop | Type | Default | Description |
---|---|---|---|
className | string | - | The class name to be applied to the component |
max | number | 100 | The maximum value of the gauge |
min | number | 0 | The minimum value of the gauge |
value | number | 0 | The current value of the gauge |
gaugePrimaryColor | string | - | The primary color of the gauge |
gaugeSecondaryColor | string | - | The secondary color of the gauge |
Credits
- Credit to @luis-code
Limited Time Offer
Ship Faster with Magic UI ProMagic UI Pro
Stop building from scratch.
Get 8 production-ready templates and 50+ premium components that your users will love.
✓
Next.js 15 + TypeScript ready✓
Copy, paste, customize in minutes✓
Save 100+ hours of development