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