Progress Ring
<wa-progress-ring>
Progress rings show how far along a determinate operation is using a circular indicator. Use them as a compact alternative to progress bars when horizontal space is limited.
Examples
Size
Use the --size custom property to set the diameter of the progress ring.
Track and Indicator Width
Use the --track-width and --indicator-width custom properties to set the width of the progress ring's track and indicator.
Colors
To change the color, use the --track-color and --indicator-color custom properties.
Labels
Use the default slot to show a label inside the progress ring.
Importing
If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.
Import this component directly from the CDN:
import 'https://ka-f.webawesome.com/[email protected]/components/progress-ring/progress-ring.js';
After installing Web Awesome via npm, import this component:
import '@awesome.me/webawesome/dist/components/progress-ring/progress-ring.js';
If you're self-hosting Web Awesome, import this component from your server:
import './webawesome/dist/components/progress-ring/progress-ring.js';
To import this component for React 18 or below, use the following code:
import WaProgressRing from '@awesome.me/webawesome/dist/react/progress-ring/index.js';
Slots
Learn more about using slots.
| Name | Description |
|---|---|
| (default) | A label to show inside the ring. |
Attributes & Properties
Learn more about attributes and properties.
| Name | Description | Reflects | |
|---|---|---|---|
css |
One or more CSSResultGroup to include in the component's shadow root. Host styles are automatically prepended.
Type
CSSResultGroup | undefinedDefault
styles |
||
labellabel |
A custom label for assistive devices.
Type
stringDefault
'' |
||
valuevalue |
The current progress as a percentage, 0 to 100.
Type
numberDefault
0 |
|
CSS custom properties
Learn more about CSS custom properties.
| Name | Description |
|---|---|
--indicator-color |
The color of the indicator.
|
--indicator-transition-duration |
The duration of the indicator's transition when the value changes.
|
--indicator-width |
The width of the indicator. Defaults to the track width.
|
--size |
The diameter of the progress ring (cannot be a percentage).
|
--track-color |
The color of the track.
|
--track-width |
The width of the track.
|
CSS parts
Learn more about CSS parts.
| Name | Description | CSS selector |
|---|---|---|
base |
The component's base wrapper. |
::part(base)
|
indicator |
The progress ring's indicator. |
::part(indicator)
|
label |
The progress ring label. |
::part(label)
|
track |
The progress ring's track. |
::part(track)
|