cv-progress-ring
A read-only circular indicator that communicates determinate or indeterminate loading/completion progress via an SVG ring.
Headless: createProgress
Usage
Anatomy
<cv-progress-ring> (host)
└── <div part="base" role="progressbar">
└── <svg part="svg" viewBox="0 0 100 100">
│ ├── <circle part="track">
│ └── <circle part="indicator">
└── <span part="label">
└── <slot>Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
value | Number | 0 | Current progress value; clamped to [min, max] |
min | Number | 0 | Minimum boundary |
max | Number | 100 | Maximum boundary |
indeterminate | Boolean | false | Switches to indeterminate (spinning animation) mode |
value-text | String | — | Static override for aria-valuetext; takes precedence over the percentage fallback |
aria-label | String | — | Accessible label passed through to headless |
Slots
| Slot | Description |
|---|---|
(default) | Label content rendered inside the ring (e.g. percentage text) |
CSS Parts
| Part | Element | Description |
|---|---|---|
base | <div> | Outer container with role="progressbar" |
svg | <svg> | SVG element containing track and indicator circles |
track | <circle> | Background circle representing the full track |
indicator | <circle> | Foreground arc representing current progress |
label | <span> | Content overlay centered inside the ring; wraps the default slot |
CSS Custom Properties
| Property | Default | Description |
|---|---|---|
--cv-progress-ring-size | 80px | Diameter of the ring (sets both inline-size and block-size) |
--cv-progress-ring-track-width | 4px | Stroke width of the background track circle |
--cv-progress-ring-indicator-width | 4px | Stroke width of the progress indicator arc |
--cv-progress-ring-track-color | var(--cv-color-surface, #141923) | Background color of the track circle stroke |
--cv-progress-ring-indicator-color | var(--cv-color-primary, #65d7ff) | Color of the filled indicator arc stroke |
--cv-progress-ring-label-color | var(--cv-color-text, #e8ecf6) | Text color for the label slot content |
Visual States
| Host selector | Description |
|---|---|
:host([indeterminate]) | Spinning/rotating animation on the indicator arc; indicator has a fixed arc length |
:host([data-complete]) | Success appearance when value >= max (indicator stroke uses --cv-color-success) |
Reactive State Mapping
cv-progress-ring is a visual adapter over headless createProgress.
| UIKit Property | Direction | Headless Binding |
|---|---|---|
value | attr -> action | actions.setValue(value) |
min | attr -> option | Passed as min in createProgress(options) |
max | attr -> option | Passed as max in createProgress(options) |
indeterminate | attr -> action | actions.setIndeterminate(value) |
value-text | attr -> option | Passed as valueText in createProgress(options) |
aria-label | attr -> option | Passed as ariaLabel in createProgress(options) |
| Headless State | Direction | DOM Reflection |
|---|---|---|
state.percentage() | state -> style | Sets stroke-dashoffset on the indicator <circle> to represent the filled arc |
state.isIndeterminate() | state -> attr | [indeterminate] host attribute |
state.isComplete() | state -> attr | [data-complete] host attribute |
contracts.getProgressProps()is spread onto the inner[part="base"]element to applyrole,aria-valuenow,aria-valuemin,aria-valuemax,aria-valuetext,aria-label, andid.- ARIA value attributes are present only in determinate mode; headless omits them in indeterminate mode.
aria-valuetextresolution order (determinate only):valueTextstatic override > rounded percentage fallback.- UIKit does not own clamping, completion, or percentage logic; headless state is the source of truth.
Events
None. cv-progress-ring is a read-only indicator with no user-modifiable state.