Progress

Documentation and examples for using Bootstrap custom progress bars featuring support for stacked bars, animated backgrounds, and text labels.

Basic Usage

HTML
template
<BProgress :value="0" />
<BProgress :value="25" />
<BProgress :value="50" />
<BProgress :value="75" />
<BProgress :value="100" />

Value

Set the maximum value with the max prop (default is 100), and the current value via the value prop (default 0).

When creating multiple bars in a single process, place the value prop on the individual BProgressBar sub-components (see the Multiple Bars section below for more details)

Labels

Add labels to your progress bars by either enabling show-progress (percentage of max) or show-value for the current absolute value. You may also set the precision (number of digits after the decimal) via the precision prop (default is 0 digits after the decimal).

No label
Value label
33
Progress label
67
Value label with precision
33.33
Progress label with precision
66.67
HTML
template
<h5>No label</h5>
<BProgress :value="33.3333" :max="50" />
<h5>Value label</h5>
<BProgress :value="33.3333" :max="50" show-value />
<h5>Progress label</h5>
<BProgress :value="33.3333" :max="50" show-progress />
<h5>Value label with precision</h5>
<BProgress :value="33.3333" :max="50" :precision="2" show-value />
<h5>Progress label with precision</h5>
<BProgress :value="33.3333" :max="50" :precision="2" show-progress />

Custom progress label

Need more control over the label? Provide your own label by using the default slot within a BProgressBar sub-component, or by using the label or label-html property on BProgressBar:

Custom label via default slot
Progress: 33.33 / 50
Custom label via property
66.67%
Custom label via property (HTML support)
33.333333
HTML
template
<h5>Custom label via default slot</h5>
<BProgress :max="50" height="2rem">
  <BProgressBar :value="33.333333">
    <span>Progress: <strong>{{ (33.333333).toFixed(2) }} / {{ 50 }}</strong></span>
  </BProgressBar>
</BProgress>

<h5 class="mt-3">Custom label via property</h5>
<BProgress :max="50">
  <BProgressBar
    :value="33.333333"
    :label="`${((33.333333 / 50) * 100).toFixed(2)}%`"
  />
</BProgress>

<h5 class="mt-3">Custom label via property (HTML support)</h5>
<BProgress :max="50">
  <BProgressBar :value="33.333333">
    <del>{{33.333333}}</del>
  </BProgressBar>
</BProgress>

Height

The height of the progress bar can be controlled with the height prop. The height value should be a standard CSS dimension (px, rem, em, etc.). The default height is 1rem.

HTML
template
<BProgress :value="25" height="1px" />
<BProgress :value="25" height="20px" />

Backgrounds

Use background variants to change the appearance of individual progress bars. The default variant is primary.

HTML
template
<BProgress variant="success" :value="25" />
<BProgress variant="info" :value="50" />
<BProgress variant="warning" :value="75" />
<BProgress variant="danger" :value="100" />

Multiple bars

Include multiple BProgressBar sub-components in a BProgress component to build a horizontally stacked set of progress bars.

HTML
template
<BProgress>
  <BProgressBar :value="15" />
  <BProgressBar :value="30" variant="success" />
  <BProgressBar :value="20" variant="info" />
</BProgress>

Striped

Set striped to apply a stripe via CSS gradient over the progress bar's background variant.

HTML
template
<BProgress striped :value="10" />
<BProgress striped :value="25" variant="success" />
<BProgress striped :value="50" variant="info" />
<BProgress striped :value="75" variant="warning" />
<BProgress striped :value="100" variant="danger" />

Animated stripes

The striped gradient can also be animated by setting the animated prop.

HTML
vue
<template>
  <BProgress :value="75" striped :animated="animate" />
  <BButton class="mt-3" @click="animate = !animate">Toggle animation</BButton>
</template>

<script setup lang="ts">
import {ref} from 'vue'

const animate = ref(false)
</script>

Component Reference

<BProgress>
PropTypeDefaultDescription
animatedbooleanundefined
bg-variantColorVariant | nullundefined
heightstringundefined
maxNumberish100
precisionNumberishundefined
show-progressbooleanundefined
show-valuebooleanundefined
stripedbooleanundefined
text-variantTextColorVariant | nullundefined
valueNumberishundefined
variantColorVariant | nullundefined
NameScopeDescription
default
<BProgressBar>
PropTypeDefaultDescription
animatedbooleanfalse
bg-variantColorVariant | nullnull
labelstringundefined
maxNumberishundefined
precisionNumberish0
show-progressbooleanfalse
show-valuebooleanfalse
stripedbooleanfalse
text-variantTextColorVariant | nullnull
valueNumberish0
variantColorVariant | nullnull
NameScopeDescription
default