Progress
Progress bars provide clear visual feedback about task completion or loading states, helping users understand system status and perceived remaining time.
import {ProgressModule} from "@qualcomm-ui/angular/progress"Overview
The progress bar can be in one of two states:
- indeterminate: the default state.
- determinate: assumed when the value prop is passed.
Indeterminate progress bars keep users informed that work is happening when timeframes are unknown.
Determinate progress bars display a shimmer effect across the filled portion while loading after 8 seconds. It is suppressed for users who prefer reduced motion. Set the shimmer prop to false to turn it off.
Examples
Simple
The simple API bundles all subcomponents together into a single directive.
<div class="w-64" label="Indeterminate" q-progress></div>
<div
hint="Optional hint"
label="Determinate"
q-progress
value="64"
valueText="64%"
></div>
Child Directives
Provide child directives to customize specific elements while keeping the simple API's default structure.
<div class="w-64" q-progress>
<div q-progress-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 class="w-64" q-progress-root value="64">
<div q-progress-label>Label</div>
<div *progressContext="let context" q-progress-value-text>
<div q-progress-value-text>{{ context.valuePercent }}%</div>
</div>
<div q-progress-track></div>
<div q-progress-error-text></div>
<div q-progress-hint>Optional hint</div>
</div>
Label Orientation
Use the labelOrientation property to change the positioning of the label and value text relative to the progress bar.
<div
class="w-96"
label="Label"
labelOrientation="side"
q-progress
value="64"
valueText="64%"
></div>
Sizes
<div label="sm" q-progress size="sm" [value]="value()"></div>
<div label="md" q-progress size="md" [value]="value()"></div>
<div label="lg" q-progress size="lg" [value]="value()"></div>
Emphasis (Color)
<div emphasis="primary" q-progress></div>
<div emphasis="neutral" q-progress></div>
Disabled
Use the disabled prop to indicate that the progress indicator is inactive.
<div class="w-64" disabled label="Indeterminate" q-progress></div>
<div
class="w-64"
disabled
label="Determinate"
q-progress
value="64"
valueText="64%"
></div>
Error Text
Error messages are displayed using two props:
The error text will only render when invalid is true.
<div
class="w-64"
defaultValue="25"
errorText="Network disconnected, please try again"
invalid
label="Loading Module"
q-progress
>
<div *progressContext="let context" q-progress-value-text>
{{ context.valuePercent }}%
</div>
</div>
Shortcuts
Track and Bar
The q-progress-track automatically renders a q-progress-bar when no children as passed to it. This makes <div q-progress-track></div> equivalent to:
<div q-progress-track>
<div q-progress-bar></div>
</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 bar. If you omit the label property, the
aria-labelof the progress element defaults to the value when determinate, and "Loading" when indeterminate.
Explorer
API
q-progress
The q-progress directive extends the q-progress-root directive with the following properties:
string<div q-progress-label>...</div>
string<div q-progress-hint>...</div>
string<div q-progress-label>...</div>
string<div q-progress-value-text>...</div>
ProgressApi
The ProgressApi is accessible from the template via the progressContext structural directive:
<ng-container *progressContext="let context">
{{ context.valuePercent }}%
</ng-container>booleannumbernumber(
value: number,
) => void
| 'indeterminate'
| 'complete'
| 'loading'
value.numbernumbermin
and max values.Composite API
q-progress-root
number'ltr' | 'rtl'
booleantrue, the progress is disabled.| 'primary'
| 'neutral'
booleantrue, the progress is marked as invalid.'top' | 'side'
numbernumberboolean| 'sm'
| 'md'
| 'lg'
numbernumberclass'qui-progress__root'data-disableddata-invaliddata-label-orientation'top' | 'side'
data-maxnumberdata-progress-part'root'data-size| 'sm'
| 'md'
| 'lg'
data-state| 'indeterminate'
| 'complete'
| 'loading'
data-valuenumberstyleq-progress-label
stringclass'qui-progress__label'data-progress-part'label'q-progress-error-text
| LucideIcon
| LucideIconData
| string
stringclass'qui-progress__error-text'data-progress-part'error-text'hiddenbooleanq-progress-hint
stringclass'qui-progress__hint'data-progress-part'hint'hiddenbooleanq-progress-value-text
class'qui-progress__value-text'data-invaliddata-progress-part'value-text'q-progress-track
stringclass'qui-progress__track'data-disableddata-progress-part'track'data-size| 'sm'
| 'md'
| 'lg'
data-state| 'indeterminate'
| 'complete'
| 'loading'
q-progress-bar
class'qui-progress__bar'data-disableddata-emphasis| 'primary'
| 'neutral'
data-invaliddata-maxnumberdata-progress-part'bar'data-shimmerdata-size| 'sm'
| 'md'
| 'lg'
data-state| 'indeterminate'
| 'complete'
| 'loading'