Components, Status
Progress bar
A horizontal bar that shows usage or progress toward a known end.
A horizontal bar that shows usage or progress. The track is accent and the fill is primary. The preview here is static. Props and accessibility behavior are settled at implementation time.
When to use
Use it for usage or progress that has a known end.
tone |
When |
|---|---|
default |
The default. |
warning |
Usage is close to the limit. |
danger |
Usage is over the limit. |
The tone colors the fill only.
Anatomy
- The track is
accent. The fill isprimary, which is ink in light and paper in dark. - The bar is 6px high and pill shaped.
- A name and a value can sit on one line above the bar. The value uses tabular figures.
Accessibility
The primitive adds role="progressbar" with aria-valuenow, aria-valuemin and aria-valuemax.
Markup
<div class="ProgressBar_meta"><span>Usage this month</span><span>US$3.20 / US$5.00</span></div>
<span class="ProgressBar_bar" role="progressbar" aria-valuenow="64" aria-valuemin="0" aria-valuemax="100"><span class="ProgressBar_fill" style="width:64%"></span></span>
Don’t
- Don’t use it for work with no known end. An agent’s work is Star. Loading is Spinner.
- Don’t use a gradient in the fill.