Skip to content

Animated Progress Bars

Bootstrap 5 dark dashboard with labelled bars that fill on scroll, a striped animated build progress bar and a stacked storage bar.

Also known as: progress bar animation, scroll triggered progress bars, skill bars, stacked storage bar

Animated Progress Bars live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A dark Bootstrap 5 dashboard section that shows three kinds of progress bars: labelled gradient bars that fill when they scroll into view, a striped animated bar driven by a simulated build, and a stacked storage bar with a legend. Use it on project dashboards, admin panels, upload screens or account pages.

How it works

The root .ap-root contains .ap-card panels. Every bar is a Bootstrap .progress element with role="progressbar" and a target value in data-ap-value. In the "Sprint goals" card each .ap-item has a head row with the label and an .ap-pct counter, followed by a slim .ap-track holding an .ap-bar with a gradient modifier such as .ap-bar--violet. The storage card uses Bootstrap's .progress-stacked wrapper, where each segment is its own .progress coloured with .ap-seg--media, .ap-seg--docs or .ap-seg--backup.

The script runs on DOMContentLoaded for every .ap-root. Bars start at zero width; those already on screen fill at once and the rest are filled by an IntersectionObserver the first time they become visible. Filling sets the width, updates aria-valuenow and counts the .ap-pct number up with requestAnimationFrame. The width change is animated by the CSS transition on .ap-bar, controlled by --ap-duration.

In .ap-build, the .ap-run button restarts the striped bar from 0 and raises it in random steps every 280 ms. The step label in .ap-build__step moves through the stages in the STEPS array. At 100% the stripes are removed, .ap-bar--done turns the bar green and the button changes to "Run again".

Customization

  • --ap-height on .ap-root in style.css: makes the slim sprint bars thicker or thinner.
  • --ap-duration on .ap-root: speeds up or slows down the fill animation.
  • data-ap-value on any .progress: sets the target percentage (0–100).
  • .ap-bar--cyan, .ap-bar--violet, .ap-bar--amber and .ap-bar--rose: swap or edit these gradients to recolour individual bars.
  • --bs-progress-bar-bg in .ap-bar--striped: changes the colour of the build bar while it runs.
  • The STEPS array at the top of script.js: rename the build stages or change the percentages where they switch.
  • --ap-bg and --ap-card on .ap-root: change the section and card backgrounds.

Use cases

  • Project dashboards: labelled sprint goal bars fill and count up when they scroll into view
  • Upload and build screens: a striped animated bar shows the stages of a running process
  • Account pages: a stacked bar with a legend shows storage used by media, docs and backups
  • Admin panels: gradient bars give quick visual feedback on completion levels

Accessibility

Every bar keeps role="progressbar" with aria-valuemin, aria-valuemax and an aria-valuenow that the script updates. Sprint bars are named through aria-labelledby, stacked segments have an aria-label such as "Media, 42 GB", and the build bar exposes its stage in aria-valuetext. The visual .ap-pct counters are aria-hidden to avoid duplicate announcements, while .ap-build__step is a role="status" region that announces each stage change. With prefers-reduced-motion the fill transition, stripe animation and count-up are all switched off.

Usage notes

Requires Bootstrap 5 (added automatically) and Bootstrap Icons. Bars stay empty without JavaScript; add inline widths if you need a no-script fallback. Replace the build simulation with real upload progress events in your own code.

Animated Progress Bars at a glance

Framework
Bootstrap 5
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 5, Bootstrap Icons
Layout
Responsive, works on mobile, dark design
Category
Progress Bars
License
Free for personal and commercial use

Questions about this template

Can I use the Animated Progress Bars code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 5 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
Animated Progress Bars – free Bootstrap 5 progress bar template
Animated Progress Bars · free Bootstrap 5 progress bar template

More Progress Bars

Upload Progress List – free Tailwind CSS progress bar template

Upload Progress List

Dark Tailwind CSS upload list with per-file progress bars, speed and time left, pause, resume, retry and remove actions, a queue and total progress.

Circular Progress Indicator – free Pure CSS progress bar template

Circular Progress Indicator

SVG ring progress indicators with an animated fill, count-up percentage, glow colors and a slider-driven demo ring with color thresholds.

Skill Progress Bars – free Tailwind CSS progress bar template

Skill Progress Bars

Animated Tailwind CSS skill bars for resumes and portfolios that fill and count up when scrolled into view, with grouped skills and a profile panel.