Bootstrap snippet and html example. bs4 alpha Dynamic Loading progress Bar

Bootstrap 4.0.0-alpha.5 snippet "bs4 alpha Dynamic Loading progress Bar" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.
Tags: loading,progress,percentage,progressbar,loader

HTML code

Clean, semantic HTML that powers this Bootstrap 4.0.0-alpha.5 snippet. Copy and paste it into your page (with Bootstrap loaded) to reproduce the exact layout shown in the preview.



<div class="container">
  <div class="text-xs-center" id="example-caption-1">Reticulating splines&hellip; <span id="percentage" class="tag tag-default">0</span>%</div>

  <div class="parent">
    <progress class="progress progress-striped" value="0" max="100"></progress>
    <div class="child">
      <div class="btn-group" role="group" aria-label="First group">
        <button type="button" class="btn btn-outline-secondary" value="25" name="success">25%</button>
        <button type="button" class="btn btn-outline-secondary" value="50" name="info">50%</button>
        <button type="button" class="btn btn-outline-secondary" value="75" name="warning">75%</button>
        <button type="button" class="btn btn-outline-secondary" value="100" name="danger">100%</button>
      </div>
    </div>
  </div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.2/js/tether.min.js"></script>

CSS code

Scoped CSS that styles the component. Paste it after Bootstrap 4.0.0-alpha.5 to keep the design, spacing, and responsiveness consistent.

body{
    background:#eee;    
}

.progress {
  height: 2.3em;
  margin-bottom: 0;
}
.btn-group {
  width: calc(100% + 3px);
}
.btn-group > .btn {
  width: 25%;
}
.btn-group > .btn:focus {
  outline: none;
  background-color: transparent;
}
.parent {
  position: relative;
  width: 100%;
  background:#fff;
}
.child {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  width: 100%;
}

Javascript/Jquery code

Lightweight JS to power any interactions this snippet needs. Drop it under your scripts (after Bootstrap 4.0.0-alpha.5) to mirror the live demo.


$.fn.removeClassMatch = function(rexp) {
  return $(this).removeClass((i, className) => {
    return (className.match(rexp) || []).join(' ');
  })
}

let progressQueue = limit => {
  controlButton(true);
  
  for (let v = 0; v <= limit; v++) {
    $('progress').delay(50).queue(function() {
      $('#percentage').text(`${v}`);
      $(this).val(`${v}`).dequeue();
      // console.log($(this).queue().length);
      if ($(this).queue().length === 0) {
        controlButton(false);
      }
    })
  }
}

let controlButton = flg => {
  $button = $('button');
  $button.css({ 'color': 'white' });
  $button.prop('disabled', flg);
}

let addClassToProgress = name => {
  let $progress = $('progress');
  $progress.removeClassMatch(/progress-.+/g)
    .addClass(`progress-striped progress-${name}`);
}

let addClassToButtons = name => {
  let $button = $('button');
  $button.removeClassMatch(/btn-outline-.+/g)
    .addClass(`btn-outline-${name}`);
}

let addClassToTag = name => {
  let $tag = $('.tag');
  $tag.removeClassMatch(/tag-.+/g)
    .addClass(`tag-${name}`);
}

$('button').on('click', function() {
  let [type, limit] = [$(this).attr('name'), parseInt($(this).val())];
  
  addClassToProgress(type);
  addClassToButtons(type);
  addClassToTag(type);
  progressQueue(limit);
}) 

Similar snippets

Bootstrap example and template. infinite page loader

infinite page loader

Bootstrap example and template. team members with skill progress

team members with skill progress

Bootstrap example and template. load page indicator

load page indicator

Bootstrap example and template. projects progress

projects progress

Bootstrap example and template. bs5 dark footer

bs5 dark footer

Bootstrap example and template. account setting or edit profile

account setting or edit profile

Bootstrap example and template. Edit profile page

Edit profile page

Bootstrap example and template. shopping cart

shopping cart

FAQ

How do I use this snippet?

Include Bootstrap 4.0.0-alpha.5, paste the HTML, add the CSS block, and include the JS (if any) to mirror the live preview.

Can I use it in commercial projects?

Yes. It’s free for personal and commercial work; check the snippets license for details.

Is it responsive?

Yes. It inherits the responsive grid and components from Bootstrap 4.0.0-alpha.5.

Bootstrap example and template. bs4 alpha Dynamic Loading progress Bar

About this bootstrap example/template

Optimized for copy‑paste: clean HTML, scoped CSS, and minimal JS so you can ship production‑ready UI faster and keep designs consistent.

Mobile‑first and responsive by default. Tested across modern browsers to reduce polish time on your project.

Already trusted in 8.0K+ views. Reuse this snippet to speed up landing pages, dashboards, or onboarding flows.

Bootstrap 4.0.0-alpha.5

<link rel='stylesheet' href='https://netdna.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css'>

<script src='https://netdna.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js'></script>

This code example is based on bootstrap 4.0.0-alpha.5 and the grid system of this framework

Responsive

Based on bootstrap framework makes all the layouts perfectly responsive for all devices

Crossbrowser compatibility

Tested on all major browsers, it works smoothly on all of them

Jquery plugins

Great built-in plugins with jquery framework, you can easy to change all declarations

semantic html 5

Built on html / css3 the code quality is really amazing

Simple Integration

This code example can be simply integrated on existing sites and new ones too, all you need to do is copy the code and start working