Progress Indicator
Progress Indicator
Section titled “Progress Indicator”SVG-based circular determinate progress indicators for @bnotk/dsx.
Live Preview
Import
Section titled “Import”<link rel="stylesheet" href="@bnotk/dsx/css/progress-indicator.css">Or use the full bundle:
<link rel="stylesheet" href="@bnotk/dsx/css/index.css">Classes
Section titled “Classes”| Class | Purpose |
|---|---|
.dsx-progress-indicator | Base circular indicator wrapper |
.dsx-progress-indicator__circle | SVG track or arc circle |
.dsx-progress-indicator__center | Centered percentage text |
.dsx-progress-indicator__color--inprogress / --success / --error | Semantic text + stroke colors |
Behavior
Section titled “Behavior”- The default size is
7.875rem(126px) and can be overridden with--ds2-progress-indicator-size. - The base circle renders the grey track with
var(--ds2-color-grey-6). - The colored circle uses
stroke-dasharrayandstroke-dashoffsetto show completion. - Both circles are rotated
-90degso progress starts at the top.
Example
Section titled “Example”<div class="dsx-progress-indicator" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="65"> <svg viewBox="0 0 126 126" width="126" height="126" aria-hidden="true"> <circle class="dsx-progress-indicator__circle" cx="63" cy="63" r="56" stroke-width="8"></circle> <circle class="dsx-progress-indicator__circle dsx-progress-indicator__color--inprogress" cx="63" cy="63" r="56" stroke-width="8" stroke-dasharray="351.86" stroke-dashoffset="123.15" ></circle> </svg> <span class="dsx-progress-indicator__center dsx-progress-indicator__color--inprogress">65%</span></div>Accessibility notes
Section titled “Accessibility notes”- Use
role="progressbar"witharia-valuemin,aria-valuemax, andaria-valuenow. - Add
aria-valuetextwhen the visual percentage needs more context. - Keep the center text visible so users are not relying on color alone.