Web Components Circular Progress Overview
The Ignite UI for Web Components Circular Progress Indicator component provides a visual indicator of an application’s process as it changes. The circular indicator updates its appearance as its state changes.
Web Components Circular Progress Example
Usage
First, you need to install the Ignite UI for Web Components by running the following command:
npm install igniteui-webcomponents
You will then need to import the IgcCircularProgressComponent
, its necessary CSS, and register its module, like so:
import {defineComponents, IgcCircularProgressComponent} from 'igniteui-webcomponents';
import 'igniteui-webcomponents/themes/light/bootstrap.css';
defineComponents(IgcCircularProgressComponent);
For a complete introduction to the Ignite UI for Web Components, read the Getting Started topic.
The simplest way to start using the IgcCircularProgressComponent
is as follows:
<igc-circular-progress value="100"></igc-circular-progress>
Progress Types
You can set the type of your indicator, using the variant
attribute. There are five types of circular progress indicators - primary (default), error, success, info, and warning.
<igc-circular-progress value="100" variant="success"></igc-circular-progress>
Indeterminate Progress
If you want to track a process that is not determined precisely, you can set the indeterminate
property. Also, you can hide the default label of the Ignite UI for Web Components IgcCircularProgressComponent
by setting the hideLabel
property and customize the progress indicator default label via the exposed labelFormat
property.
<igc-circular-progress value="100" indeterminate="true"></igc-circular-progress>
The following sample demonstrates the above configuration:
Animation Duration
You can use the animationDuration
property on the IgcCircularProgressComponent
component to specify how long the animation cycle should take in milliseconds.
<igc-circular-progress animation-duration="5000" indeterminate></igc-circular-progress>
Gradient Progress
Customizing the progress bar in order to use a color gradient instead of a solid color could be done via the exposed gradient
slot and IgcCircularGradientComponent
which defines the gradient stops.
[!Note] For each
IgcCircularGradientComponent
defined as gradient slot of Ignite UI for Web ComponentsIgcCircularProgressComponent
a SVG stop element would be created. The values passed ascolor
,offset
andopacity
would be set as stop-color, offset and stop-opacity of the SVG element without further validations.
<igc-circular-progress>
<igc-circular-gradient slot="gradient" offset="0%" color="#ff9a40"></igc-circular-gradient>
<igc-circular-gradient slot="gradient" offset="50%" color="#1eccd4"></igc-circular-gradient>
<igc-circular-gradient slot="gradient" offset="100%" color="#ff0079"></igc-circular-gradient>
</igc-circular-progress>
Styling
The Ignite UI for Web Components Circular Procress Indicator component exposes CSS parts for almost all of its inner elements.
The following table lists all CSS parts exposed by the Circular Progress:
Name | Description |
---|---|
svg | The progress SVG element. |
gradient_start | The progress linear-gradient start color. |
gradient_end | The progress linear-gradient end color. |
track | The progress ring's track area. |
fill | The progress indicator area. |
label | The progress label. |
value | The progress label value. |
indeterminate | The progress indeterminate state. |
primary | The progress indicator primary state. |
danger | The progress indicator error state. |
warning | The progress indicator warning state. |
info | The progress indicator info state. |
success | The progress indicator success state. |