Progress Ring
A small visual indicator that communicates ongoing task execution.
import {ProgressRingModule} from "@qualcomm-ui/angular/progress-ring"Overview
The progress ring can be in one of two states:
- indeterminate: the default state.
- determinate: assumed when the value prop is passed.
Indeterminate progress rings keep users informed that work is happening when timeframes are unknown.
Examples
Simple
The simple API bundles all subcomponents together into a single directive.
<div label="Label" q-progress-ring></div>Child Directives
Provide child directives to customize specific elements while keeping the simple API's default structure.
<div q-progress-ring>
<div q-progress-ring-label>Label</div>
</div>Composite
Build with the composite API for granular control. This API requires you to provide each subcomponent, but gives you full control over the structure.
<div q-progress-ring-root>
<div q-progress-ring-circle-container>
<svg q-progress-ring-circle></svg>
</div>
<div q-progress-ring-label>Loading...</div>
</div>Controlled Value
When the value prop is set, the filled portion of the circle will represent the total percent relative to max and min. This is referred to as the "determinate" state.
<div q-progress-ring size="lg" [value]="value()">
<svg aria-label="Loading" q-progress-ring-circle></svg>
<div *progressRingContext="let context" q-progress-ring-value-text>
{{ context.valuePercent }}%
</div>
</div>Value Text
Display the value text using the q-progress-ring-value-text directive. The value text only shows when the size is lg or xl.
Sizes
Use the size prop to change the size of the circle.
Thickness
Use the thickness prop to change the pixel width of the track and bar.
<div class="py-2" q-progress-ring size="lg" [thickness]="8"></div>Accessibility
- When the value is supplied, the component automatically provides the corresponding
aria-value*attributes to the element. - The progress element is automatically marked with
role="progressbar". - The label is automatically associated with the progress ring. If you omit the label property, the
aria-labelof the progress element defaults to the value when determinate, and "Loading" when indeterminate.
API
q-progress-ring
The q-progress-ring extends the q-progress-ring-root with the following props:
| Prop | Type |
|---|---|
string | |
To customize the element, provide it using the directive instead:
<div q-progress-ring-error-text>...</div> | |
Accessible label for the progress ring, rendered below the circle. | string |
To customize the element, provide it using the directive instead:
<div q-progress-ring-label>...</div> | |
string<div q-progress-ring-error-text>...</div>
string<div q-progress-ring-label>...</div>
ProgressApi
The ProgressApi is accessible from the template via the progressRingContext structural directive:
<ng-container *progressRingContext="let context">
{{ context.valuePercent }}%
</ng-container>| Prop | Type |
|---|---|
Whether the progress bar is indeterminate | boolean |
The maximum value of the progress bar. | number |
The minimum value of the progress bar. | number |
Sets the value of the progress bar. | ( |
The computed state of the progress bar, based on the value. | | 'indeterminate' |
The current value of the progress bar. | number |
The current value of the progress bar as a percentage, computed from the min
and max values. | number |
booleannumbernumber(
value: number,
) => void
| 'indeterminate'
| 'complete'
| 'loading'
value.numbernumbermin
and max values.Composite API
q-progress-ring-root
| Prop | Type | Default |
|---|---|---|
The initial value of the progress when it is first rendered. Use when you do
not need to control the state of the progress. | number | |
The document's text/writing direction. | 'ltr' | 'rtl' | "ltr" |
Governs the color of the progress circle. | | 'primary' | 'primary' |
If true, the progress is marked as invalid. | boolean | |
Maximum value | number | 100 |
Minimum value | number | 0 |
Governs the height of the progress circle and track. | | 'xxs' | 'md' |
| string | ||
Current progress value (0-100) | number | |
Callback fired when the value changes. | number |
number'ltr' | 'rtl'
| 'primary'
| 'neutral'
booleantrue, the progress is marked as invalid.numbernumber| 'xxs'
| 'xs'
| 'sm'
| 'md'
| 'lg'
| 'xl'
| number
| string
| number
The default value varies based on the size of the progress circle.
numbernumber| Attribute / Property | Value |
|---|---|
class | 'qui-progress-ring__root' |
data-invalid | |
data-max | number |
data-part | 'root' |
data-scope | 'progress' |
data-size | | 'xxs' |
data-state | | 'indeterminate' |
data-value | number |
style |
class'qui-progress-ring__root'data-invaliddata-maxnumberdata-part'root'data-scope'progress'data-size| 'xxs'
| 'xs'
| 'sm'
| 'md'
| 'lg'
| 'xl'
| number
data-state| 'indeterminate'
| 'complete'
| 'loading'
data-valuenumberstyleq-progress-ring-label
| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
string| Attribute / Property | Value |
|---|---|
class | 'qui-progress-ring__label' |
data-part | 'label' |
data-scope | 'progress' |
class'qui-progress-ring__label'data-part'label'data-scope'progress'q-progress-ring-value-text
| Attribute / Property | Value |
|---|---|
class | 'qui-progress-ring__value-text' |
data-invalid | |
data-part | 'value-text' |
data-scope | 'progress' |
hidden | boolean |
class'qui-progress-ring__value-text'data-invaliddata-part'value-text'data-scope'progress'hiddenbooleanq-progress-ring-error-text
| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
string| Attribute / Property | Value |
|---|---|
class | 'qui-progress-ring__error-text' |
data-part | 'error-text' |
data-scope | 'progress' |
hidden | boolean |
class'qui-progress-ring__error-text'data-part'error-text'data-scope'progress'hiddenbooleanq-progress-ring-circle-container
| Attribute / Property | Value |
|---|---|
class | 'qui-progress-ring__circle-container' |
data-part | 'circle-container' |
data-scope | 'progress' |
class'qui-progress-ring__circle-container'data-part'circle-container'data-scope'progress'q-progress-ring-circle
| Prop | Type |
|---|---|
id attribute. If
omitted, a unique identifier will be generated for accessibility. | string |
string| Attribute / Property | Value |
|---|---|
class | 'qui-progress-ring__circle' |
data-emphasis | | 'primary' |
data-part | 'circle' |
data-scope | 'progress' |
data-size | | 'xxs' |
data-state | | 'indeterminate' |
style |
class'qui-progress-ring__circle'data-emphasis| 'primary'
| 'neutral'
data-part'circle'data-scope'progress'data-size| 'xxs'
| 'xs'
| 'sm'
| 'md'
| 'lg'
| 'xl'
| number
data-state| 'indeterminate'
| 'complete'
| 'loading'
styleq-progress-ring-track
| Attribute / Property | Value |
|---|---|
class | 'qui-progress-ring__track' |
data-part | 'circle-track' |
data-scope | 'progress' |
data-size | | 'xxs' |
data-state | | 'indeterminate' |
class'qui-progress-ring__track'data-part'circle-track'data-scope'progress'data-size| 'xxs'
| 'xs'
| 'sm'
| 'md'
| 'lg'
| 'xl'
| number
data-state| 'indeterminate'
| 'complete'
| 'loading'
q-progress-ring-bar
| Attribute / Property | Value |
|---|---|
class | 'qui-progress-ring__bar' |
data-emphasis | | 'primary' |
data-invalid | |
data-max | number |
data-part | 'circle-bar' |
data-scope | 'progress' |
data-size | | 'xxs' |
data-state | | 'indeterminate' |
style |
class'qui-progress-ring__bar'data-emphasis| 'primary'
| 'neutral'
data-invaliddata-maxnumberdata-part'circle-bar'data-scope'progress'data-size| 'xxs'
| 'xs'
| 'sm'
| 'md'
| 'lg'
| 'xl'
| number
data-state| 'indeterminate'
| 'complete'
| 'loading'
style