Skip to content

Progress Bar ​

A linear progress bar. Set percent from 0.0 to 1.0.

a-sxr-progress-bar Component ​

Properties ​

PropertyDescriptionDefault Value
background-colorBackground color of progress bar#202127
active-colorColor for indicating progress level#2563EB
percentProgress amount, from 0.0 to 1.00.5
heightHeight of item1
widthWidth of item1
marginMargin around item0 0 0 0
html
<a-sxr-progressbar
	width="2.5" height="0.25"
	percent="0.4"
	margin="0 0 0.05 0"
>
</a-sxr-progressbar>

Primitive name

The component is sxr-progress-bar but the primitive is a-sxr-progressbar (no hyphen between progress and bar).

Updating progress ​

percent is live-updatable:

js
progressbar.setAttribute('percent', '0.8')

The fill animates to the new value without recreating the widget.

Circular alternatives ​

For a ring-shaped meter use Circle Loader, or Circle Timer for a countdown ring.