Bootstrap Vue Progress Component
Documentation and examples for using Bootstrap Vue progress bars featuring support for stacked bars, animated backgrounds, and text labels.
Example
Progress components are built with two HTML elements, some CSS to set the width, and a few attributes. We don't use the HTML5 <progress>
elementopen in new window, ensuring you can stack progress bars, animate them, and place text labels over them.
Basic usage
<CProgress class="mb-3">
<CProgressBar :value="0"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar :value="25"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar :value="50"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar :value="75"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar :value="100"/>
</CProgress>
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Labels
Add labels to your progress bars by placing text within the <CProgressBar>
.
<CProgress class="mb-3">
<CProgressBar :value="25">25%</CProgressBar>
</CProgress>
2
3
Height
We only set a height
value on the <CProgress>
, so if you change that value the inner <CProgressBar>
will automatically resize accordingly.
<CProgress :height="1" class="mb-3">
<CProgressBar :value="25"></CProgressBar>
</CProgress>
<CProgress :height="20" class="mb-3">
<CProgressBar :value="25"></CProgressBar>
</CProgress>
2
3
4
5
6
Backgrounds
Use color
prop to change the appearance of individual progress bars.
<CProgress class="mb-3">
<CProgressBar color="success" :value="25"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar color="info" :value="50"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar color="warning" :value="75"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar color="danger" :value="100"/>
</CProgress>
2
3
4
5
6
7
8
9
10
11
12
Multiple bars
Include multiple progress bars in a progress component if you need.
<CProgress class="mb-3">
<CProgressBar :value="15"/>
<CProgressBar color="success" :value="30"/>
<CProgressBar color="info" :value="20"/>
</CProgress>
2
3
4
5
Striped
Add variant="striped"
to any <CProgressBar>
to apply a stripe via CSS gradient over the progress bar's background color.
<CProgress class="mb-3">
<CProgressBar color="success" variant="striped" :value="25"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar color="info" variant="striped" :value="50"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar color="warning" variant="striped" :value="75"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar color="danger" variant="striped" :value="100"/>
</CProgress>
2
3
4
5
6
7
8
9
10
11
12
Animated stripes
The striped gradient can also be animated. Add animated
property to <CProgressBar>
to animate the stripes right to left via CSS3 animations.
<CProgress class="mb-3">
<CProgressBar color="success" variant="striped" animated :value="25"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar color="info" variant="striped" animated :value="50"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar color="warning" variant="striped" animated :value="75"/>
</CProgress>
<CProgress class="mb-3">
<CProgressBar color="danger" variant="striped" animated :value="100"/>
</CProgress>
2
3
4
5
6
7
8
9
10
11
12
API
CProgress
import { CProgress } from '@coreui/bootstrap-vue'
// or
import CProgress from '@coreui/bootstrap-vue/src/components/progress/CProgress'
2
3
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
height | Sets the height of the component. If you set that value the inner <CProgressBar> will automatically resize accordingly. | number | - | - |
thin | Makes progress bar thinner. | boolean | - | |
white | Change the default color to white. | boolean | - |
CProgressBar
import { CProgressBar } from '@coreui/bootstrap-vue'
// or
import CProgressBar from '@coreui/bootstrap-vue/src/components/progress/CProgressBar'
2
3
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
animated | Use to animate the stripes right to left via CSS3 animations. | boolean | - | |
color | * Sets the color context of the component to one of Bootstrap Vue’s themed colors. | string | 'primary' , 'secondary' , 'success' , 'danger' , 'warning' , 'info' , 'dark' , 'light' | |
value | The percent to progress the ProgressBar. | number | - | 0 |
variant | Set the progress bar variant to optional striped. | string | 'striped' | - |