Bootstrap5 Progress Bar

A progress bar can show the completion process of a user's task.

The steps to create a basic progress bar are as follows:

  • Add one with.progressclass <div>.
  • Next, inside the above <div>, add one with class.progress-barempty <div>.
  • Add a style attribute with a percentage width, for example style="width:70%"indicates that the progress bar is at70%position.

Example

<div class="progress"> <div class="progress-bar" style="width:70%"></div> </div>

Try it Yourself »

Progress Bar Height

The default height of the progress bar is 16px. We can use CSS'sheightproperty to modify it:

Example

<div class="progress" style="height:20px;"> <div class="progress-bar" style="width:40%;"></div> </div>

Try it Yourself »

Progress Bar Label

You can add text inside the progress bar, such as the percentage of progress:

Example

<div class="progress"> <div class="progress-bar" style="width:70%">70%</div> </div>

Try it Yourself »

Progress Bars with Different Colors

By default, the progress bar is blue. Bootstrap5 also provides progress bars in the following colors:

Example

<div class="progress"> <div class="progress-bar bg-success" style="width:40%"></div> </div> <div class="progress"> <div class="progress-bar bg-info" style="width:50%"></div> </div> <div class="progress"> <div class="progress-bar bg-warning" style="width:60%"></div> </div> <div class="progress"> <div class="progress-bar bg-danger" style="width:70%"></div> </div>

Try it Yourself »

Striped Progress Bar

You can use the.progress-bar-stripedclass to create a striped progress bar:

Example

<div class="progress"> <div class="progress-bar progress-bar-striped" style="width:40%"></div> </div>

Try it Yourself »

Animated Progress Bar

Use the.progress-bar-animatedclass to add animation to the progress bar:

Example

<div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 40%"></div>

Try it Yourself »

Mixed Color Progress Bar

The progress bar can be set to multiple colors:

Example

<div class="progress"> <div class="progress-bar bg-success" style="width:40%"> Free Space </div> <div class="progress-bar bg-warning" style="width:10%"> Warning </div> <div class="progress-bar bg-danger" style="width:20%"> Danger </div> </div>

Try it Yourself »
Other Extensions