Radial progress bars are used to indicate the progress of a process, in a circular fasion.
Radial progress bars utilize a value attribute to set the progress and
can have various colors / sizes, along with content inside.
The max is always set to 100 due to the way they are rendered, so value
should always be a percentage of the bar that is filled.
The content doesn't have to be just text!
You can also control the size, thickness, and color of the radial progress.
size defaults to 5rem and must include unitsthickness defaults to calc(size / 10) and must include unitsThe radial progress component animates smoothly when the value changes. Here's a simple JavaScript example that automatically changes to a random percentage between 8% and 100% every 1.5 seconds:
.flex.flex-col.items-center.gap-4
#animated-radial{class: "radial-progress", style: "--value: 50; --size: 8rem; --thickness: 8px;", role: "progressbar"}
50%
:javascript
// Use window property to avoid redeclaration errors and allow cross-navigation access
if (window.radialInterval) {
clearInterval(window.radialInterval);
}
function updateRadial(value) {
const radial = document.getElementById('animated-radial');
if (!radial) {
clearInterval(window.radialInterval);
return;
}
radial.style.setProperty('--value', value);
radial.textContent = value + '%';
}
function getRandomPercentage() {
return Math.floor(Math.random() * (100 - 8 + 1)) + 8;
}
function animateRadial() {
const newValue = getRandomPercentage();
updateRadial(newValue);
}
// Start the animation
window.radialInterval = setInterval(animateRadial, 1500);
Create virtual credit / debit cards to keep your real info safe.
Get $5 when you sign up — free to start!
Everything you need to grow your business with confidence!
CRM, Lead Generation, Project Management, Contracts, Online Payments, and more!
The ads above are affiliate links to products I regularly use and highly
recommend.
I may receive a commission if you decide to purchase.