Skip to content

Bootstrap Progress

Progress bars visually communicate completion status for tasks, uploads, or multi-step processes. This lesson covers building basic, striped, animated, and stacked progress bars.

Bootstrap Progress Overview

A progress bar starts with an outer .progress container and an inner .progress-bar element whose width is set inline as a percentage. The inner bar carries role="progressbar" along with aria-valuenow, aria-valuemin, and aria-valuemax attributes so assistive technology can announce the current completion percentage.

Visual variants include progress-bar-striped for diagonal stripes, progress-bar-animated for a moving stripe animation (indicating active, ongoing work), and stacking multiple progress-bar elements inside one .progress container to show several segments of a total.

Concept Description Common Usage
.progress Outer track container Wraps one or more progress-bar segments
.progress-bar Inner filled segment with a percentage width Visual representation of completion
role="progressbar" + aria-* Accessibility attributes for current value Screen reader announcement of progress
progress-bar-striped/animated Diagonal stripes with optional motion Indicating active or in-progress tasks
Stacked progress bars Multiple progress-bar elements in one container Multi-category totals like storage usage

Bootstrap Progress Example

<div class="progress" role="progressbar" aria-label="Upload progress" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100">
  <div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 65%">65%</div>
</div>

<div class="progress mt-3">
  <div class="progress-bar bg-success" style="width: 40%">Images</div>
  <div class="progress-bar bg-warning" style="width: 25%">Videos</div>
  <div class="progress-bar bg-danger" style="width: 15%">Documents</div>
</div>

The first progress bar shows an animated, striped bar at 65% with aria attributes describing an upload's current state. The second example stacks three colored segments inside one progress container to represent different categories of storage usage totaling 80% of the available space.

Top 10 Bootstrap Progress Examples

These are the progress bar patterns you'll use to visualize completion and status.

# Example Syntax
1 Basic progress bar <div class="progress"><div class="progress-bar" style="width: 50%"></div></div>
2 Labeled progress bar <div class="progress-bar" style="width: 75%">75%</div>
3 Striped progress bar <div class="progress-bar progress-bar-striped" style="width: 50%"></div>
4 Animated progress bar <div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 50%"></div>
5 Colored progress bar <div class="progress-bar bg-success" style="width: 90%"></div>
6 Thin progress bar <div class="progress" style="height: 4px;">...</div>
7 Stacked progress bars <div class="progress"><div class="progress-bar" style="width: 30%"></div><div class="progress-bar bg-warning" style="width: 20%"></div></div>
8 Progress with ARIA attributes role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"
9 Full progress bar <div class="progress-bar bg-success" style="width: 100%">Complete</div>
10 Empty/zero progress bar <div class="progress-bar" style="width: 0%"></div>

Best Practices

  • Always include role="progressbar" with matching aria-valuenow, aria-valuemin, and aria-valuemax attributes.
  • Update the width style and ARIA value together whenever progress changes via JavaScript.
  • Use progress-bar-animated only for active, ongoing tasks, not completed or static values.
  • Choose a color that reflects status, such as bg-danger for critically low remaining values.
  • Keep stacked progress bar segments labeled or paired with a legend explaining each color.
  • Use a thinner custom height for subtle, secondary progress indicators.
  • Show a text label or percentage when precision matters to the user, not just a visual bar.

Common Mistakes

  • Setting the visual width without updating the corresponding aria-valuenow attribute.
  • Using progress-bar-animated on a bar that represents a static, already-completed value.
  • Stacking too many thin segments, making individual categories hard to distinguish.
  • Forgetting an aria-label on the outer progress container describing what is being tracked.
  • Hardcoding percentage text that doesn't match the actual width value.
  • Using a progress bar for binary complete/incomplete states where a badge or icon would be clearer.

Key Takeaways

  • progress and progress-bar together create a track and its filled segment.
  • ARIA attributes (role, aria-valuenow, aria-valuemin, aria-valuemax) make progress bars accessible.
  • Striped and animated modifiers help distinguish active, ongoing tasks from static values.
  • Multiple progress-bar elements can stack inside one progress container for category breakdowns.
  • Color should reflect the actual status or urgency represented by the progress value.

Pro Tip

When updating a progress bar with JavaScript, write a small helper that sets both the style.width and the aria-valuenow attribute together in one call, so the visual and accessible states never drift out of sync.