Progress Bar
Progress bars show how far along an ongoing operation is as a horizontal fill. Use them for file uploads, multi-step flows, or any task with measurable progress.
Examples
Label
Use the label attribute to tell assistive devices how to announce the progress bar.
Indeterminate
Add the indeterminate attribute when an operation is pending but its progress can't be measured. In this state, value is ignored and the label, if present, isn't shown.
Customizing
Set the --track-height custom property to change the bar's thickness, and --track-color / --indicator-color to recolor it.
Showing Values
Use the default slot to show a value inside the bar.
API
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-bar/progress-bar.js';
After installing Web Awesome via npm, import this component:
import '@awesome.me/webawesome/dist/components/progress-bar/progress-bar.js';
If you're self-hosting Web Awesome, import this component from your server:
import './webawesome/dist/components/progress-bar/progress-bar.js';
To import this component for React 18 or below, use the following code:
import WaProgressBar from '@awesome.me/webawesome/dist/react/progress-bar/index.js';
Slots
Learn more about using slots.
| Name | Description |
|---|---|
| (default) | A label to show inside the progress indicator. |
Attributes & Properties
Learn more about attributes and properties.
| Name | Description | Reflects |
|---|---|---|
indeterminateindeterminate |
When true, percentage is ignored, the label is hidden, and the progress bar is drawn in an indeterminate state.
Type
boolean
Default
false
|
|
labellabel |
A custom label for assistive devices.
Type
string
Default
''
|
|
valuevalue |
The current progress as a percentage, 0 to 100.
Type
number
Default
0
|
|
CSS Custom Properties
Learn more about CSS custom properties.
| Name | Description |
|---|---|
--indicator-color |
The color of the indicator.
Default
var(--wa-color-brand-fill-loud)
|
--track-color |
The color of the track.
Default
var(--wa-color-neutral-fill-normal)
|
--track-height |
The height of the track.
Default
1rem
|
CSS Parts
Learn more about CSS parts.
| Name | Description | CSS selector |
|---|---|---|
indicator |
The progress bar's indicator. |
::part(indicator)
|
label |
The progress bar's label. |
::part(label)
|
progress-bar |
The component's outer wrapper. |
::part(progress-bar)
|
base |
Deprecated. Use the progress-bar part instead. |
::part(base)
|