Progress bars are used to show that the system is working when this isn’t otherwise obvious. Typical examples are when the system is Ready, Loading, Waiting, Working, Processing, Saving, Printing etc. Progress bars are then used to describe the current status of the application. Read more about progress bars in the UX Guidelines.
style-src 'unsafe-inline'
, then you won't be able to use inline ,style
attributes to set progress bar widths as shown in our examples below. Alternative methods for setting the widths that are compatible with strict CSPs include using a little custom JavaScript (that sets element.style.width
) or using custom CSS classes.
There are two types of work indicators, determinate and indeterminate.
// Basic progress-bar
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%;">
<span class="sr-only">20% Complete</span>
</div>
</div>
// Slimmer progress-bar
<div class="progress progress-sm">
<div class="progress-bar" role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width: 50%;">
<span class="sr-only">50% Complete</span>
</div>
</div>
// Extra-slimer progress-bar
<div class="progress progress-xs">
<div class="progress-bar" role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width: 70%;">
<span class="sr-only">70% Complete</span>
</div>
</div>
// Progress-bar without default margin bottom
<div class="progress no-margin">
<div class="progress-bar" role="progressbar" aria-valuenow="56" aria-valuemin="0" aria-valuemax="100" style="width: 56%;">
<span class="sr-only">56% Complete</span>
</div>
</div>
// Progress-bar with label/short description and percentage label
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="35" aria-valuemin="0" aria-valuemax="100" style="width: 35%;">
<span class="percentage">35%</span>
</div>
<span class="progress-label">Label / short description</span>
</div>
// or
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="35" aria-valuemin="0" aria-valuemax="100" style="width: 35%;">
<span class="percentage">35%</span>
</div>
<div class="progress-label">Label / short description</div>
</div>