Progress
Basic example
How it works
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> element, ensuring you can stack progress bars,
animate them, and place
text labels over them.
- We use the
.cd-progressas a wrapper to indicate the max value of the progress bar. - We use the inner
.cd-progress-barto indicate the progress so far. - The
.cd-progress-barrequires an inline style, utility class, or custom CSS to set their width. - The
.cd-progress-baralso requires some role and aria attributes to make it accessible.
Put that all together, and you have the following examples.
Labels
Add labels to your progress bars by placing text within the .cd-progress-bar.
To make the label visible you need to set a proper height to the bar.
Height
We only set a height value on the .cd-progress, so if you change that value the inner
.cd-progress-bar will
automatically resize accordingly.
Colors
Use background utility classes to change the appearance of individual progress bars.