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.

Label
<div label="Label" q-progress-ring></div>

Child Directives

Provide child directives to customize specific elements while keeping the simple API's default structure.

Label
<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.

Loading...
<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.

0%
<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.

0%
Loading...

Sizes

Use the size prop to change the size of the circle.

xxs
xs
sm
md
lg
xl

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-label of 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:

PropType
Error text rendered below the progress ring when invalid is true.
string
Accessible label for the progress ring, rendered below the circle.
string
Type
string
Description
Error text rendered below the progress ring when invalid is true.
Type
string
Description
Accessible label for the progress ring, rendered below the circle.

ProgressApi

The ProgressApi is accessible from the template via the progressRingContext structural directive:

<ng-container *progressRingContext="let context">
  {{ context.valuePercent }}%
</ng-container>
PropType
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.
    (
    value: number,
    ) => void
    The computed state of the progress bar, based on the value.
    | 'indeterminate'
    | 'complete'
    | 'loading'
    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
    Type
    boolean
    Description
    Whether the progress bar is indeterminate
    Type
    number
    Description
    The maximum value of the progress bar.
    Type
    number
    Description
    The minimum value of the progress bar.
    Type
    (
    value: number,
    ) => void
    Description
    Sets the value of the progress bar.
      Type
      | 'indeterminate'
      | 'complete'
      | 'loading'
      Description
      The computed state of the progress bar, based on the value.
      Type
      number
      Description
      The current value of the progress bar.
      Type
      number
      Description
      The current value of the progress bar as a percentage, computed from the min and max values.

      Composite API

      q-progress-ring-root

      PropTypeDefault
      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'
      | 'neutral'
      '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'
      | 'xs'
      | 'sm'
      | 'md'
      | 'lg'
      | 'xl'
      | number
      'md'
      
      The thickness of the progress ring in pixels. If supplied as a number, it will be used as the pixel value.

      The default value varies based on the
      size of the progress circle.
      | string
      | number
      Current progress value (0-100)
      number
      Callback fired when the value changes.
      number
      Type
      number
      Description
      The initial value of the progress when it is first rendered. Use when you do not need to control the state of the progress.
      Type
      'ltr' | 'rtl'
      Description
      The document's text/writing direction.
      Type
      | 'primary'
      | 'neutral'
      Description
      Governs the color of the progress circle.
      Type
      boolean
      Description
      If true, the progress is marked as invalid.
      Type
      number
      Description
      Maximum value
      Type
      number
      Description
      Minimum value
      Type
      | 'xxs'
      | 'xs'
      | 'sm'
      | 'md'
      | 'lg'
      | 'xl'
      | number
      Description
      Governs the height of the progress circle and track.
      Type
      | string
      | number
      Description
      The thickness of the progress ring in pixels. If supplied as a number, it will be used as the pixel value.

      The default value varies based on the
      size of the progress circle.
      Type
      number
      Description
      Current progress value (0-100)
      Type
      number
      Description
      Callback fired when the value changes.

      q-progress-ring-label

      PropType
      id attribute. If omitted, a unique identifier will be generated for accessibility.
      string
      Type
      string
      Description
      id attribute. If omitted, a unique identifier will be generated for accessibility.

      q-progress-ring-value-text

      q-progress-ring-error-text

      PropType
      id attribute. If omitted, a unique identifier will be generated for accessibility.
      string
      Type
      string
      Description
      id attribute. If omitted, a unique identifier will be generated for accessibility.

      q-progress-ring-circle-container

      q-progress-ring-circle

      PropType
      id attribute. If omitted, a unique identifier will be generated for accessibility.
      string
      Type
      string
      Description
      id attribute. If omitted, a unique identifier will be generated for accessibility.

      q-progress-ring-track

      q-progress-ring-bar