We use cookies to ensure you get the best experience on our website. Read our privacy policy

Skip to main content

Directory

Progress Component

The Progress component provides visual feedback for ongoing processes in your application. With smooth animations and state management, it helps users understand the completion status of tasks.

  • Check Circle

    Multiple Sizes: Small, medium, and large variants

  • Check Circle

    State Management: Success and error states

  • Check Circle

    Smooth Animations: Built-in transitions

  • Check Circle

    Accessible: Semantic HTML with ARIA support

Basic Progress
<Progress value={0.5} max={1} label="Basic Progress" />
Small Progress Medium Progress Large Progress
<Progress value={75} max={100} size="sm" label="Small Progress" />
<Progress value={75} max={100} size="md" label="Medium Progress" />
<Progress value={75} max={100} size="lg" label="Large Progress" />
Success State Error State
<Progress value={100} max={100} data-state="success" label="Success State" />
<Progress value={30} max={100} data-state="error" label="Error State" />
Progress Component Props Extends <progress> HTMLElement
Prop Type Default Description
label string Label text for the progress bar
size 'sm' | 'md' | 'lg' md Size variant of the progress bar

The Progress component exposes methods for programmatic control:

// Get progress instance
const progress = document.querySelector('progress-wrapper');
// Update progress
progress.setProgress(0.75); // Set to 75%
// Reset progress
progress.resetProgress();
// Set state
progress.setState('success');
progress.setState('error');

Here’s how to create an animated progress bar:

import { ready } from '@/components/NST-components/base';
import type { ProgressElement } from '@/components/NST-components/UI/progress/data';
const progressBars = await ready(
document.querySelector<ProgressElement>('progress-wrapper')
);
function animateProgress() {
let currentValue = 0;
const interval = setInterval(() => {
currentValue += 0.005; // Increment by 0.005 every 20ms
if (progressBars) {
progressBars.progress = currentValue;
}
if (currentValue >= 1) {
clearInterval(interval);
// Wait 2 seconds then reset and start again
setTimeout(() => {
if (progressBars) {
progressBars.reset();
}
setTimeout(() => {
animateProgress();
}, 100);
}, 2000);
}
}, 20);
}
// Start the animation
animateProgress();

Limited Time Launch Sale

Add professional progress indicators to your website with our AstroJS starter template. Get started now!

GET 60% OFF!
North Star Themes Logo

Subscribe to our newsletter

Get the latest AstroJS tips and tricks right to your inbox

Email: [email protected]

© 2025 North Star Themes

Web Kit Provided By North Star Themes