Progress Bar¶
A thin bar in the theme accent over a faint track, such as a download in a row.
Decision¶
| When | Use |
|---|---|
| A known percent that sits in a row or under a heading | Progress Bar |
| A scheduled task shown inside its button | Task Progress Button |
Usage¶
<div class="stolon-progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="40">
<div class="stolon-progress-bar" style="width: 40%"></div>
</div>
Classes: stolon-progress, stolon-progress-bar, and stolon-btn-progress for the bar along a button's bottom edge.
States and Modifiers¶
stolon-progress-barhas a 0.3s width transition. Set its width yourself.- The track is a 15 percent wash of the text color.
stolon-btn-progresson astolon-progress-bardraws it thin along the bottom of a button withstolon-btn-progress-host, starting empty. The Task Progress Button draws it.
Gotchas¶
- There is no JavaScript. Add
role="progressbar"witharia-valuenowwhen the value matters to assistive tech. pollTaskProgressbuilds its bar from it on a medium or large button, asstolon-progress-bar stolon-btn-progress. A small button gets a Progress Ring pie beside it instead.
Reference¶
Generated from the code by scripts/build-docs.mjs. Edit the code, not this section.
| Class | What it looks like |
|---|---|
stolon-progress |
Thin progress bar in the accent over a faint track, such as a download in a table row |
stolon-progress-bar |
Accent fill whose width is the progress |
stolon-progress-bar.stolon-btn-progress |
A progress bar along the bottom edge of a button, which the task progress button draws, thin and starting empty |
Example¶
Example Code¶
<!-- title: Progress Bar -->
<div class="stolon-progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="40" aria-label="Download">
<div class="stolon-progress-bar" style="width: 40%"></div>
</div>
<div style="display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 16px;">
<button type="button" class="raised stolon-button stolon-primary stolon-btn-progress-host"><span>Run 55%</span><div class="stolon-progress-bar stolon-btn-progress" style="width: 55%"></div></button>
<button type="button" class="raised stolon-button stolon-destructive stolon-btn-progress-host"><span>Remove 55%</span><div class="stolon-progress-bar stolon-btn-progress" style="width: 55%"></div></button>
<button type="button" class="raised stolon-button stolon-secondary stolon-large stolon-btn-progress-host"><span>Scan 55%</span><div class="stolon-progress-bar stolon-btn-progress" style="width: 55%"></div></button>
<span style="display: inline-flex; align-items: center;"><button type="button" class="raised stolon-button stolon-primary stolon-small"><span>Refresh 55%</span></button><span class="stolon-ring stolon-ring-small stolon-ring-pie stolon-btn-progress-pie" role="progressbar" aria-label="Refresh" aria-valuemin="0" aria-valuemax="100" aria-valuenow="55"><svg viewBox="0 0 36 36" aria-hidden="true"><circle class="stolon-ring-track" cx="18" cy="18" r="9" fill="none" pathLength="100"></circle><circle class="stolon-ring-arc" cx="18" cy="18" r="9" fill="none" pathLength="100" stroke-dasharray="55 100"></circle></svg></span></span>
</div>