1e41f4b71Sopenharmony_ci# progress
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ciThe **\<Progress>** component is used to provide a progress bar that displays the progress of content loading or an operation.
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ci> **NOTE**
7e41f4b71Sopenharmony_ci>
8e41f4b71Sopenharmony_ci> The APIs of this module are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci## Child Components
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ciNot supported
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci## Attributes
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ciIn addition to the [universal attributes](js-service-widget-common-attributes.md), the following attributes are supported.
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ci| Name| Type| Default Value| Mandatory| Description|
21e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- |
22e41f4b71Sopenharmony_ci| type | string | horizontal | No| Type of the progress bar, which cannot be changed dynamically. Available values are as follows:<br>- **horizontal**: linear progress bar.<br>- **circular**: loading progress bar.<br>- **ring**: ring progress bar.<br>- **scale-ring**: ring progress bar with a scale.<br>- **arc**: arc progress bar.<br>- **eclipse**: eclipse progress bar.|
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ciDifferent types of progress bars support different attributes.
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci- When the type is **horizontal**, **ring**, or **scale-ring**, the following attributes are supported.
27e41f4b71Sopenharmony_ci    | Name| Type| Default Value| Mandatory| Description|
28e41f4b71Sopenharmony_ci  | -------- | -------- | -------- | -------- | -------- |
29e41f4b71Sopenharmony_ci  | percent | number | 0 | No| Current progress. The value ranges from 0 to 100.|
30e41f4b71Sopenharmony_ci  | secondarypercent(Rich) | number | 0 | No| Secondary progress. The value ranges from 0 to 100.|
31e41f4b71Sopenharmony_ci
32e41f4b71Sopenharmony_ci- When the type is **ring** or **scale-ring**, the following attributes are supported.
33e41f4b71Sopenharmony_ci    | Name| Type| Default Value| Mandatory| Description|
34e41f4b71Sopenharmony_ci  | -------- | -------- | -------- | -------- | -------- |
35e41f4b71Sopenharmony_ci  | clockwise | boolean | true | No| Whether the ring progress bar moves in a clockwise direction.|
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci- When the type is **arc**, the following attributes are supported.
38e41f4b71Sopenharmony_ci    | Name| Type| Default Value| Mandatory| Description|
39e41f4b71Sopenharmony_ci  | -------- | -------- | -------- | -------- | -------- |
40e41f4b71Sopenharmony_ci  | percent | number | 0 | No| Current progress. The value ranges from 0 to 100.|
41e41f4b71Sopenharmony_ci
42e41f4b71Sopenharmony_ci
43e41f4b71Sopenharmony_ci## Styles
44e41f4b71Sopenharmony_ci
45e41f4b71Sopenharmony_ciIn addition to the [universal styles](js-service-widget-common-styles.md), the following styles are supported.
46e41f4b71Sopenharmony_ci
47e41f4b71Sopenharmony_ciWhen the type is **horizontal**, the following styles are supported.
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci| Name| Type| Default Value| Mandatory| Description|
50e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- |
51e41f4b71Sopenharmony_ci| color | &lt;color&gt; | \#ff007dff | No| Color of the progress bar.|
52e41f4b71Sopenharmony_ci| stroke-width | &lt;length&gt; | 4px | No| Stroke width of the progress bar.|
53e41f4b71Sopenharmony_ci| background-color | &lt;color&gt; | - | No| Background color of the progress bar.|
54e41f4b71Sopenharmony_ci| secondary-color | &lt;color&gt; | - | No| Color of the secondary progress bar.|
55e41f4b71Sopenharmony_ci
56e41f4b71Sopenharmony_ciWhen the type is **circular**, the following styles are supported.
57e41f4b71Sopenharmony_ci
58e41f4b71Sopenharmony_ci| Name| Type| Default Value| Mandatory| Description|
59e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- |
60e41f4b71Sopenharmony_ci| color | &lt;color&gt; | - | No| Color of the dot on the loading progress bar.|
61e41f4b71Sopenharmony_ci
62e41f4b71Sopenharmony_ciWhen the type is **ring** or **scale-ring**, the following styles are supported.
63e41f4b71Sopenharmony_ci
64e41f4b71Sopenharmony_ci| Name| Type| Default Value| Mandatory| Description|
65e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- |
66e41f4b71Sopenharmony_ci| color | &lt;color&gt;&nbsp;\|&nbsp;&lt;linear-gradient&gt; | - | No| Color of the ring progress bar. The **ring** type supports the linear gradient<br>defined by two colors, for example, **color&nbsp;=&nbsp;linear-gradient(\#ff0000,&nbsp;\#00ff00)**.|
67e41f4b71Sopenharmony_ci| background-color | &lt;color&gt; | - | No| Background color of the ring progress bar.|
68e41f4b71Sopenharmony_ci| secondary-color | &lt;color&gt; | - | No| Color of the secondary ring progress bar.|
69e41f4b71Sopenharmony_ci| stroke-width | &lt;length&gt; | 10px | No| Width of the ring progress bar.|
70e41f4b71Sopenharmony_ci| scale-width | &lt;length&gt; | - | No| Scale thickness of the ring progress bar with a scale. This style takes effect only when the type is **scale-ring**.|
71e41f4b71Sopenharmony_ci| scale-number | number | 120 | No| Number of scales of the ring progress bar with a scale. This style takes effect only when the type is **scale-ring**.|
72e41f4b71Sopenharmony_ci
73e41f4b71Sopenharmony_ciWhen the type is **arc**, the following styles are supported.
74e41f4b71Sopenharmony_ci
75e41f4b71Sopenharmony_ci| Name| Type| Default Value| Mandatory| Description|
76e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- |
77e41f4b71Sopenharmony_ci| color | &lt;color&gt; | - | No| Color of the arc progress bar.|
78e41f4b71Sopenharmony_ci| background-color | &lt;color&gt; | - | No| Background color of the arc progress bar.|
79e41f4b71Sopenharmony_ci| stroke-width | &lt;length&gt; | - | No| Stroke width of the arc progress bar.<br>A larger width value means that the progress bar is closer to the center of the circle. The width is always within the radius range.|
80e41f4b71Sopenharmony_ci| start-angle | &lt;deg&gt; | 240 | No| Start angle of the arc progress bar, which starts from the direction of zero o'clock. The value ranges from 0 to 360 degrees (clockwise).|
81e41f4b71Sopenharmony_ci| total-angle | &lt;deg&gt; | 240 | No| Total length of the arc progress bar. The value ranges from –360 to 360. A negative number indicates anticlockwise.|
82e41f4b71Sopenharmony_ci| center-x | &lt;length&gt; | - | No| Center of the arc progress bar (with the upper left corner of this widget as the coordinate origin). This style must be used together with **center-y** and **radius**.|
83e41f4b71Sopenharmony_ci| center-y | &lt;length&gt; | - | No| Center of the arc progress bar (with the upper left corner of this widget as the coordinate origin). This style must be used together with **center-x** and **radius**.|
84e41f4b71Sopenharmony_ci| radius | &lt;length&gt; | - | No| Radius of the arc progress bar. This style must be used together with **center-x** and **center-y**.|
85e41f4b71Sopenharmony_ci
86e41f4b71Sopenharmony_ci
87e41f4b71Sopenharmony_ci## Events
88e41f4b71Sopenharmony_ci
89e41f4b71Sopenharmony_ciThe [universal events](js-service-widget-common-events.md) are supported.
90e41f4b71Sopenharmony_ci
91e41f4b71Sopenharmony_ci
92e41f4b71Sopenharmony_ci## Example
93e41f4b71Sopenharmony_ci
94e41f4b71Sopenharmony_ci
95e41f4b71Sopenharmony_ci```html
96e41f4b71Sopenharmony_ci<!--xxx.hml -->
97e41f4b71Sopenharmony_ci<div class="container">
98e41f4b71Sopenharmony_ci  <progress class="min-progress" type="scale-ring"  percent= "10" secondarypercent="50"></progress>
99e41f4b71Sopenharmony_ci  <progress class="min-progress" type="horizontal" percent= "10" secondarypercent="50"></progress>
100e41f4b71Sopenharmony_ci  <progress class="min-progress" type="arc" percent= "10"></progress>
101e41f4b71Sopenharmony_ci  <progress class="min-progress" type="ring" percent= "10" secondarypercent="50"></progress>
102e41f4b71Sopenharmony_ci</div>
103e41f4b71Sopenharmony_ci```
104e41f4b71Sopenharmony_ci
105e41f4b71Sopenharmony_ci
106e41f4b71Sopenharmony_ci```css
107e41f4b71Sopenharmony_ci/* xxx.css */
108e41f4b71Sopenharmony_ci.container {
109e41f4b71Sopenharmony_ci  flex-direction: column;
110e41f4b71Sopenharmony_ci  height: 100%;
111e41f4b71Sopenharmony_ci  width: 100%;
112e41f4b71Sopenharmony_ci  align-items: center;
113e41f4b71Sopenharmony_ci}
114e41f4b71Sopenharmony_ci.min-progress {
115e41f4b71Sopenharmony_ci  width: 300px;
116e41f4b71Sopenharmony_ci  height: 300px;
117e41f4b71Sopenharmony_ci}
118e41f4b71Sopenharmony_ci```
119e41f4b71Sopenharmony_ci**4 x 4 widget**
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_ci![progress](figures/progress.png)
122