1e41f4b71Sopenharmony_ci# Progress 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **\<Progress>** component represents a progress indicator that displays the progress of content loading or an operation. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci## Child Components 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ciNot supported 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci## APIs 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ciProgress(options: ProgressOptions\<Type\>) 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ciCreates a progress indicator. 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9. 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci**Parameters** 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 28e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 29e41f4b71Sopenharmony_ci| options | ProgressOptions\<Type\> | Yes | Parameters of the progress indicator. | 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci## ProgressOptions\<Type\> 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 36e41f4b71Sopenharmony_ci| -------------------------- | ----------------------------------- | ---- | ---------------------------------------- | 37e41f4b71Sopenharmony_ci| value | number | Yes | Current progress. If the value is less than 0, the value **0** is used. If the value is greater than that of **total**, the value of **total** is used.<br>Default value: **0**<br>**Widget capability**: This API can be used in ArkTS widgets since API version 9. | 38e41f4b71Sopenharmony_ci| total | number | No | Total progress. If this parameter is set to a value less than or equal to 0, the value **100** is used.<br>Default value: **100**<br>**Widget capability**: This API can be used in ArkTS widgets since API version 9. | 39e41f4b71Sopenharmony_ci| type<sup>8+</sup> | [ProgressType](#progresstype8) | No | Style of the progress indicator.<br>Default value: **ProgressType.Linear**<br>**Widget capability**: This API can be used in ArkTS widgets since API version 9. | 40e41f4b71Sopenharmony_ci| style<sup>(deprecated)</sup> | [ProgressStyle](#progressstyle) | No | Style of the progress indicator.<br>This parameter is deprecated since API version 8. You are advised to use **type** instead.<br>Default value: **ProgressStyle.Linear** | 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci## ProgressType<sup>8+</sup> 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9. 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 47e41f4b71Sopenharmony_ci 48e41f4b71Sopenharmony_ci| Name | Description | 49e41f4b71Sopenharmony_ci| ---------------------- | ---------------------------------------- | 50e41f4b71Sopenharmony_ci| Linear | Linear style. Since API version 9, the progress indicator adaptively switches to vertical layout if the height is greater than the width. | 51e41f4b71Sopenharmony_ci| Ring | Indeterminate ring style. The ring fills up as the progress increases. | 52e41f4b71Sopenharmony_ci| Eclipse | Eclipse style, which visualizes the progress in a way similar to the moon waxing from new to full. | 53e41f4b71Sopenharmony_ci| ScaleRing | Determinate ring style, which is similar to the clock scale. Since API version 9, when the outer circles of scales overlap, the progress indicator is automatically converted to the **Ring** style. | 54e41f4b71Sopenharmony_ci| Capsule | Capsule style. At both ends, the progress indicator works in a same manner as the eclipse style. In the middle part of the capsule, the progress indicator works in a same manner as the linear style. If the height is greater than the width, the progress indicator adaptively switches to vertical layout. | 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ci## ProgressStyle 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9. 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_ci| Name | Description | 63e41f4b71Sopenharmony_ci| --------- | ---------------------------------------- | 64e41f4b71Sopenharmony_ci| Linear | Linear style. | 65e41f4b71Sopenharmony_ci| Ring<sup>8+</sup> | Indeterminate ring style. The ring fills up as the progress increases. | 66e41f4b71Sopenharmony_ci| Eclipse | Eclipse style, which visualizes the progress in a way similar to the moon waxing from new to full. | 67e41f4b71Sopenharmony_ci| ScaleRing<sup>8+</sup> | Determinate ring style, which is similar to the clock scale. | 68e41f4b71Sopenharmony_ci| Capsule<sup>8+</sup> | Capsule style. At both ends, the progress indicator works in a same manner as the eclipse style. In the middle part of the capsule, the progress indicator works in a same manner as the linear style. If the height is greater than the width, the progress indicator adaptively switches to vertical layout. | 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_ci## Attributes 71e41f4b71Sopenharmony_ci 72e41f4b71Sopenharmony_ciIn addition to the [universal attributes](ts-universal-attributes-size.md), the following attributes are supported. 73e41f4b71Sopenharmony_ci 74e41f4b71Sopenharmony_ci### value 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_civalue(value: number) 77e41f4b71Sopenharmony_ci 78e41f4b71Sopenharmony_ciSets the current progress. If the value is less than 0, the value **0** is used. If the value is greater than that of **total**, the value of **total** is used. Invalid values do not take effect. 79e41f4b71Sopenharmony_ci 80e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9. 81e41f4b71Sopenharmony_ci 82e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 83e41f4b71Sopenharmony_ci 84e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 85e41f4b71Sopenharmony_ci 86e41f4b71Sopenharmony_ci**Parameters** 87e41f4b71Sopenharmony_ci 88e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 89e41f4b71Sopenharmony_ci| ------ | ------ | ---- | ------------ | 90e41f4b71Sopenharmony_ci| value | number | Yes | Current progress.<br> Default value: **0**| 91e41f4b71Sopenharmony_ci 92e41f4b71Sopenharmony_ci### color 93e41f4b71Sopenharmony_ci 94e41f4b71Sopenharmony_cicolor(value: ResourceColor | LinearGradient) 95e41f4b71Sopenharmony_ci 96e41f4b71Sopenharmony_ciSets the foreground color of the progress indicator. 97e41f4b71Sopenharmony_ci 98e41f4b71Sopenharmony_ci**LinearGradient** is supported for the **Ring** type since API version 12. 99e41f4b71Sopenharmony_ci 100e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9, except that **LinearGradient** is not supported. 101e41f4b71Sopenharmony_ci 102e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 103e41f4b71Sopenharmony_ci 104e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 105e41f4b71Sopenharmony_ci 106e41f4b71Sopenharmony_ci**Parameters** 107e41f4b71Sopenharmony_ci 108e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 109e41f4b71Sopenharmony_ci| ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 110e41f4b71Sopenharmony_ci| value | [ResourceColor](ts-types.md#resourcecolor) \| [LinearGradient<sup>10+</sup>](ts-basic-components-datapanel.md#lineargradient10) | Yes | Foreground color of the progress indicator.<br>Default value:<br>- Capsule:<br> API version 9 or earlier: **'\#ff007dff'**<br> API version 10: **'\#33006cde'**<br> API version 11 or later: **'\#33007dff'**<br>- Ring:<br> API version 9 or earlier: **'\#ff007dff'**<br> API version 10 or later: start: **'\#ff86c1ff'**, end: **'\#ff254ff7'**<br>- Other styles: **'\#ff007dff'** | 111e41f4b71Sopenharmony_ci 112e41f4b71Sopenharmony_ci### backgroundColor 113e41f4b71Sopenharmony_ci 114e41f4b71Sopenharmony_cibackgroundColor(value: ResourceColor) 115e41f4b71Sopenharmony_ci 116e41f4b71Sopenharmony_ciSets the background color of the progress indicator. The settings of the universal attribute [backgroundColor](./ts-universal-attributes-background.md#backgroundcolor) applies to the background of the progress indicator instead of the entire **\<Progress>** component. 117e41f4b71Sopenharmony_ci 118e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9. 119e41f4b71Sopenharmony_ci 120e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 121e41f4b71Sopenharmony_ci 122e41f4b71Sopenharmony_ci**Parameters** 123e41f4b71Sopenharmony_ci 124e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 125e41f4b71Sopenharmony_ci| ------ | ------------------------------------------ | ---- | ------------------------------------------------------------ | 126e41f4b71Sopenharmony_ci| value | [ResourceColor](ts-types.md#resourcecolor) | Yes | Background color of the progress indicator.<br>Default value:<br>- Capsule:<br> API version 9 or earlier: **'\#19182431'**<br> API version 10 or later: **'\#33ffffff'**<br>- Ring:<br> API version 9 or earlier: **'\#19182431'**<br> API version 10: **'\#08182431'**<br> API version 11 or later: **'\#0c182431'**<br>- Other styles: **'\#19182431'** | 127e41f4b71Sopenharmony_ci 128e41f4b71Sopenharmony_ci### style<sup>8+</sup> 129e41f4b71Sopenharmony_ci 130e41f4b71Sopenharmony_cistyle(value: ProgressStyleOptions \| CapsuleStyleOptions \| RingStyleOptions \| LinearStyleOptions \| ScaleRingStyleOptions \| EclipseStyleOptions) 131e41f4b71Sopenharmony_ci 132e41f4b71Sopenharmony_ciSets the component style. 133e41f4b71Sopenharmony_ci 134e41f4b71Sopenharmony_ci**Widget capability**: This API can be used in ArkTS widgets since API version 9. 135e41f4b71Sopenharmony_ci 136e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 137e41f4b71Sopenharmony_ci 138e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 139e41f4b71Sopenharmony_ci 140e41f4b71Sopenharmony_ci**Parameters** 141e41f4b71Sopenharmony_ci 142e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 143e41f4b71Sopenharmony_ci| ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 144e41f4b71Sopenharmony_ci| value | [ProgressStyleOptions<sup>8+</sup>](#progressstyleoptions8) \| [CapsuleStyleOptions<sup>10+</sup>](#capsulestyleoptions10) \| <br>[RingStyleOptions<sup>10+</sup>](#ringstyleoptions10) \| [LinearStyleOptions<sup>10+</sup>](#linearstyleoptions10) \| <br>[ScaleRingStyleOptions<sup>10+</sup>](#scaleringstyleoptions10) \| [EclipseStyleOptions<sup>10+</sup>](#eclipsestyleoptions10) | Yes | Component style.<br>- **CapsuleStyleOptions**: capsule style.<br>- **RingStyleOptions**: ring style.<br>- **LinearStyleOptions**: linear style.<br>- **ScaleRingStyleOptions**: determinate ring style.<br>- **EclipseStyleOptions**: eclipse style.<br>- **ProgressStyleOptions**: basic style.<br>**ProgressStyleOptions** does not support other parameter types currently. | 145e41f4b71Sopenharmony_ci 146e41f4b71Sopenharmony_ci### contentModifier<sup>12+</sup> 147e41f4b71Sopenharmony_cicontentModifier(modifier:ContentModifier\<ProgressConfiguration\>) 148e41f4b71Sopenharmony_ci 149e41f4b71Sopenharmony_ciCreates a content modifier. 150e41f4b71Sopenharmony_ci 151e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 152e41f4b71Sopenharmony_ci 153e41f4b71Sopenharmony_ci**Parameters** 154e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 155e41f4b71Sopenharmony_ci| ------ | ------ | ---- | ------------ | 156e41f4b71Sopenharmony_ci| modifier | [ContentModifier\<ProgressConfiguration\>](#progressconfiguration12) | Yes | Content modifier to apply to the current component.<br>**modifier**: content modifier. You need a custom class to implement the **ContentModifier** API. | 157e41f4b71Sopenharmony_ci 158e41f4b71Sopenharmony_ci### privacySensitive<sup>12+</sup> 159e41f4b71Sopenharmony_ci 160e41f4b71Sopenharmony_ciprivacySensitive(isPrivacySensitiveMode: Optional\<boolean\>) 161e41f4b71Sopenharmony_ci 162e41f4b71Sopenharmony_ciSets whether to enable privacy mode. 163e41f4b71Sopenharmony_ci 164e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 165e41f4b71Sopenharmony_ci 166e41f4b71Sopenharmony_ci**Parameters** 167e41f4b71Sopenharmony_ci 168e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 169e41f4b71Sopenharmony_ci| ------ | --------------------------------------------------------- | ---- | ----------------------------------------------------- | 170e41f4b71Sopenharmony_ci| isPrivacySensitiveMode | [Optional\<boolean\>] | Yes | Whether to enable privacy mode, in which the progress is cleared and the text is obscured.<br>**NOTE**<br>If this parameter is set to **null**, privacy mode is disabled.<br>[Enabling privacy mode requires widget framework support.](./ts-universal-attributes-obscured.md) | 171e41f4b71Sopenharmony_ci 172e41f4b71Sopenharmony_ci## ProgressConfiguration<sup>12+</sup> 173e41f4b71Sopenharmony_ci| Name | Type | Description | 174e41f4b71Sopenharmony_ci| ------ | ------ | ------------| 175e41f4b71Sopenharmony_ci| value | number | Current progress. | 176e41f4b71Sopenharmony_ci| total | number | Total progress. | 177e41f4b71Sopenharmony_ci## ProgressStyleOptions<sup>8+</sup> 178e41f4b71Sopenharmony_ci 179e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 180e41f4b71Sopenharmony_ci 181e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 182e41f4b71Sopenharmony_ci| ------------ | ---------------------------- | ---- | ------------------------------------------------------------------------------------------ | 183e41f4b71Sopenharmony_ci| strokeWidth | [Length](ts-types.md#length) | No | Stroke width of the progress indicator. It cannot be set in percentage.<br>Default value: **4.0vp** | 184e41f4b71Sopenharmony_ci| scaleCount | number | No | Number of divisions on the ring-style process indicator.<br>Default value: **120** | 185e41f4b71Sopenharmony_ci| scaleWidth | [Length](ts-types.md#length) | No | Scale width of the ring-style progress bar. It cannot be set in percentage. If it is greater than the value of **strokeWidth**, the default scale width is used.<br>Default value: **2.0vp** | 186e41f4b71Sopenharmony_ci| enableSmoothEffect<sup>10+</sup> | boolean | No | Whether to enable the smooth effect. When this effect is enabled, the progress change to the set value takes place gradually. Otherwise, it takes place immediately.<br>Default value: **true** | 187e41f4b71Sopenharmony_ci 188e41f4b71Sopenharmony_ci## CapsuleStyleOptions<sup>10+</sup> 189e41f4b71Sopenharmony_ci 190e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 191e41f4b71Sopenharmony_ci 192e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 193e41f4b71Sopenharmony_ci| ------------- | ------- | ---- | -------- | 194e41f4b71Sopenharmony_ci| borderColor | [ResourceColor](ts-types.md#resourcecolor) | No | Border color.<br>Default value:<br>API version 10: **'\#33006cde'**<br>API version 11 or later: **'\#33007dff'** | 195e41f4b71Sopenharmony_ci| borderWidth | [Length](ts-types.md#length) | No | Border width. It cannot be set in percentage.<br>Default value: **1vp** | 196e41f4b71Sopenharmony_ci| content | string | No | Text content, which can be customized . | 197e41f4b71Sopenharmony_ci| font | [Font](ts-types.md#font) | No | Text style.<br>Default value:<br>- Font size (cannot be set in percentage): **12fp**<br>- Other attributes: following the settings of the **\<Text>** component.| 198e41f4b71Sopenharmony_ci| fontColor | [ResourceColor](ts-types.md#resourcecolor) | No | Font color.<br>Default value: **'\#ff182431'** | 199e41f4b71Sopenharmony_ci| enableScanEffect | boolean | No | Whether to enable the scan effect.<br>Default value: **false** | 200e41f4b71Sopenharmony_ci| showDefaultPercentage | boolean | No | Whether to show the percentage of the current progress. This attribute does not take effect when the **content** attribute is set.<br>Default value: **false** | 201e41f4b71Sopenharmony_ci| enableSmoothEffect | boolean | No | Whether to enable the smooth effect. When this effect is enabled, the progress change to the set value takes place gradually. Otherwise, it takes place immediately.<br>Default value: **true** | 202e41f4b71Sopenharmony_ci 203e41f4b71Sopenharmony_ci## RingStyleOptions<sup>10+</sup> 204e41f4b71Sopenharmony_ci 205e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 206e41f4b71Sopenharmony_ci 207e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 208e41f4b71Sopenharmony_ci| ------------- | ---------------------------- | ---- | ------------------------------------------------------------------------------------------ | 209e41f4b71Sopenharmony_ci| strokeWidth | [Length](ts-types.md#length) | No | Stroke width of the progress indicator. It cannot be set in percentage. A value greater than or equal to the radius evaluates to half of the radius.<br>Default value: **4.0vp** | 210e41f4b71Sopenharmony_ci| shadow | boolean | No | Whether to enable the shadow effect.<br>Default value: **false** | 211e41f4b71Sopenharmony_ci| status | [ProgressStatus<sup>10+</sup>](#progressstatus10) | No | Status of the progress indicator. When this parameter is set to **LOADING**, the check update animation is played, and the **value** settings do not take effect. When the value changes from **LOADING** to **PROGRESSING**, the check update animation stops when it has reached the end state.<br>Default value: **ProgressStatus.PROGRESSING** | 212e41f4b71Sopenharmony_ci| enableScanEffect | boolean | No | Whether to enable the scan effect.<br>Default value: **false** | 213e41f4b71Sopenharmony_ci| enableSmoothEffect | boolean | No | Whether to enable the smooth effect. When this effect is enabled, the progress change to the set value takes place gradually. Otherwise, it takes place immediately.<br>Default value: **true** | 214e41f4b71Sopenharmony_ci 215e41f4b71Sopenharmony_ci## LinearStyleOptions<sup>10+</sup> 216e41f4b71Sopenharmony_ci 217e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 218e41f4b71Sopenharmony_ci 219e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 220e41f4b71Sopenharmony_ci| ------------- | ---------------------------- | ---- | ------------------------------------------------------------------------------------------ | 221e41f4b71Sopenharmony_ci| strokeWidth | [Length](ts-types.md#length) | No | Stroke width of the progress indicator. It cannot be set in percentage.<br>Default value: **4.0vp** | 222e41f4b71Sopenharmony_ci| strokeRadius | [PX](ts-types.md#px10) \| [VP](ts-types.md#vp10) \| [LPX](ts-types.md#lpx10) \| [Resource](ts-types.md#resource)| No | Rounded corner radius of the progress indicator.<br>Value range: [0, strokeWidth/2] Default value: **strokeWidth/2** | 223e41f4b71Sopenharmony_ci| enableScanEffect | boolean | No | Whether to enable the scan effect.<br>Default value: **false** | 224e41f4b71Sopenharmony_ci| enableSmoothEffect | boolean | No | Whether to enable the smooth effect. When this effect is enabled, the progress change to the set value takes place gradually. Otherwise, it takes place immediately.<br>Default value: **true** | 225e41f4b71Sopenharmony_ci 226e41f4b71Sopenharmony_ci## ScaleRingStyleOptions<sup>10+</sup> 227e41f4b71Sopenharmony_ci 228e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 229e41f4b71Sopenharmony_ci 230e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 231e41f4b71Sopenharmony_ci| ------------ | ---------------------------- | ---- | ------------------------------------------------------------------------------------------ | 232e41f4b71Sopenharmony_ci| strokeWidth | [Length](ts-types.md#length) | No | Stroke width of the progress indicator. It cannot be set in percentage.<br>Default value: **4.0vp** | 233e41f4b71Sopenharmony_ci| scaleCount | number | No | Number of divisions on the ring-style process indicator.<br>Default value: **120** | 234e41f4b71Sopenharmony_ci| scaleWidth | [Length](ts-types.md#length) | No | Scale width of the ring-style progress bar. It cannot be set in percentage. If it is greater than the value of **strokeWidth**, the default scale width is used.<br>Default value: **2.0vp** | 235e41f4b71Sopenharmony_ci| enableSmoothEffect | boolean | No | Whether to enable the smooth effect. When this effect is enabled, the progress change to the set value takes place gradually. Otherwise, it takes place immediately.<br>Default value: **true** | 236e41f4b71Sopenharmony_ci 237e41f4b71Sopenharmony_ci## EclipseStyleOptions<sup>10+</sup> 238e41f4b71Sopenharmony_ci 239e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 240e41f4b71Sopenharmony_ci 241e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 242e41f4b71Sopenharmony_ci| ------------ | ---------------------------- | ---- | ------------------------------------------------------------------------------------------ | 243e41f4b71Sopenharmony_ci| enableSmoothEffect | boolean | No | Whether to enable the smooth effect. When this effect is enabled, the progress change to the set value takes place gradually. Otherwise, it takes place immediately.<br>Default value: **true** | 244e41f4b71Sopenharmony_ci 245e41f4b71Sopenharmony_ci## ProgressStatus<sup>10+</sup> 246e41f4b71Sopenharmony_ci 247e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 248e41f4b71Sopenharmony_ci 249e41f4b71Sopenharmony_ci| Name | Description | 250e41f4b71Sopenharmony_ci| ----------------------- | ---------------- | 251e41f4b71Sopenharmony_ci| LOADING | Loading. | 252e41f4b71Sopenharmony_ci| PROGRESSING | The progress is being updated. | 253e41f4b71Sopenharmony_ci 254e41f4b71Sopenharmony_ci## Events 255e41f4b71Sopenharmony_ci 256e41f4b71Sopenharmony_ciThe [universal events](ts-universal-events-click.md) are supported. 257e41f4b71Sopenharmony_ci 258e41f4b71Sopenharmony_ci## Example 259e41f4b71Sopenharmony_ci 260e41f4b71Sopenharmony_ci### Example 1 261e41f4b71Sopenharmony_ci 262e41f4b71Sopenharmony_ciThis example shows the effect of the basic attributes for different types of progress indicators. 263e41f4b71Sopenharmony_ci 264e41f4b71Sopenharmony_ci```ts 265e41f4b71Sopenharmony_ci// xxx.ets 266e41f4b71Sopenharmony_ci@Entry 267e41f4b71Sopenharmony_ci@Component 268e41f4b71Sopenharmony_cistruct ProgressExample { 269e41f4b71Sopenharmony_ci build() { 270e41f4b71Sopenharmony_ci Column({ space: 15 }) { 271e41f4b71Sopenharmony_ci Text('Linear Progress').fontSize(9).fontColor(0xCCCCCC).width('90%') 272e41f4b71Sopenharmony_ci Progress({ value: 10, type: ProgressType.Linear }).width(200) 273e41f4b71Sopenharmony_ci Progress({ value: 20, total: 150, type: ProgressType.Linear }).color(Color.Grey).value(50).width(200) 274e41f4b71Sopenharmony_ci 275e41f4b71Sopenharmony_ci 276e41f4b71Sopenharmony_ci Text('Eclipse Progress').fontSize(9).fontColor(0xCCCCCC).width('90%') 277e41f4b71Sopenharmony_ci Row({ space: 40 }) { 278e41f4b71Sopenharmony_ci Progress({ value: 10, type: ProgressType.Eclipse }).width(100) 279e41f4b71Sopenharmony_ci Progress({ value: 20, total: 150, type: ProgressType.Eclipse }).color(Color.Grey).value(50).width(100) 280e41f4b71Sopenharmony_ci } 281e41f4b71Sopenharmony_ci 282e41f4b71Sopenharmony_ci Text('ScaleRing Progress').fontSize(9).fontColor(0xCCCCCC).width('90%') 283e41f4b71Sopenharmony_ci Row({ space: 40 }) { 284e41f4b71Sopenharmony_ci Progress({ value: 10, type: ProgressType.ScaleRing }).width(100) 285e41f4b71Sopenharmony_ci Progress({ value: 20, total: 150, type: ProgressType.ScaleRing }) 286e41f4b71Sopenharmony_ci .color(Color.Grey).value(50).width(100) 287e41f4b71Sopenharmony_ci .style({ strokeWidth: 15, scaleCount: 15, scaleWidth: 5 }) 288e41f4b71Sopenharmony_ci } 289e41f4b71Sopenharmony_ci 290e41f4b71Sopenharmony_ci // scaleCount vs. scaleWidth 291e41f4b71Sopenharmony_ci Row({ space: 40 }) { 292e41f4b71Sopenharmony_ci Progress({ value: 20, total: 150, type: ProgressType.ScaleRing }) 293e41f4b71Sopenharmony_ci .color(Color.Grey).value(50).width(100) 294e41f4b71Sopenharmony_ci .style({ strokeWidth: 20, scaleCount: 20, scaleWidth: 5 }) 295e41f4b71Sopenharmony_ci Progress({ value: 20, total: 150, type: ProgressType.ScaleRing }) 296e41f4b71Sopenharmony_ci .color(Color.Grey).value(50).width(100) 297e41f4b71Sopenharmony_ci .style({ strokeWidth: 20, scaleCount: 30, scaleWidth: 3 }) 298e41f4b71Sopenharmony_ci } 299e41f4b71Sopenharmony_ci 300e41f4b71Sopenharmony_ci Text('Ring Progress').fontSize(9).fontColor(0xCCCCCC).width('90%') 301e41f4b71Sopenharmony_ci Row({ space: 40 }) { 302e41f4b71Sopenharmony_ci Progress({ value: 10, type: ProgressType.Ring }).width(100) 303e41f4b71Sopenharmony_ci Progress({ value: 20, total: 150, type: ProgressType.Ring }) 304e41f4b71Sopenharmony_ci .color(Color.Grey).value(50).width(100) 305e41f4b71Sopenharmony_ci .style({ strokeWidth: 20 }) 306e41f4b71Sopenharmony_ci } 307e41f4b71Sopenharmony_ci 308e41f4b71Sopenharmony_ci Text('Capsule Progress').fontSize(9).fontColor(0xCCCCCC).width('90%') 309e41f4b71Sopenharmony_ci Row({ space: 40 }) { 310e41f4b71Sopenharmony_ci Progress({ value: 10, type: ProgressType.Capsule }).width(100).height(50) 311e41f4b71Sopenharmony_ci Progress({ value: 20, total: 150, type: ProgressType.Capsule }) 312e41f4b71Sopenharmony_ci .color(Color.Grey) 313e41f4b71Sopenharmony_ci .value(50) 314e41f4b71Sopenharmony_ci .width(100) 315e41f4b71Sopenharmony_ci .height(50) 316e41f4b71Sopenharmony_ci } 317e41f4b71Sopenharmony_ci }.width('100%').margin({ top: 30 }) 318e41f4b71Sopenharmony_ci } 319e41f4b71Sopenharmony_ci} 320e41f4b71Sopenharmony_ci``` 321e41f4b71Sopenharmony_ci 322e41f4b71Sopenharmony_ci 323e41f4b71Sopenharmony_ci 324e41f4b71Sopenharmony_ci### Example 2 325e41f4b71Sopenharmony_ci 326e41f4b71Sopenharmony_ciThis example shows the effect of visual attributes of the ring style progress indicator. 327e41f4b71Sopenharmony_ci 328e41f4b71Sopenharmony_ci```ts 329e41f4b71Sopenharmony_ci// xxx.ets 330e41f4b71Sopenharmony_ci@Entry 331e41f4b71Sopenharmony_ci@Component 332e41f4b71Sopenharmony_cistruct ProgressExample { 333e41f4b71Sopenharmony_ci private gradientColor: LinearGradient = new LinearGradient([{ color: Color.Yellow, offset: 0.5 }, 334e41f4b71Sopenharmony_ci { color: Color.Orange, offset: 1.0 }]) 335e41f4b71Sopenharmony_ci build() { 336e41f4b71Sopenharmony_ci Column({ space: 15 }) { 337e41f4b71Sopenharmony_ci Text('Gradient Color').fontSize(9).fontColor(0xCCCCCC).width('90%') 338e41f4b71Sopenharmony_ci Progress({ value: 70, total: 100, type: ProgressType.Ring }) 339e41f4b71Sopenharmony_ci .width(100).style({ strokeWidth: 20 }) 340e41f4b71Sopenharmony_ci .color(this.gradientColor) 341e41f4b71Sopenharmony_ci 342e41f4b71Sopenharmony_ci Text('Shadow').fontSize(9).fontColor(0xCCCCCC).width('90%') 343e41f4b71Sopenharmony_ci Progress({ value: 70, total: 100, type: ProgressType.Ring }) 344e41f4b71Sopenharmony_ci .width(120).color(Color.Orange) 345e41f4b71Sopenharmony_ci .style({ strokeWidth: 20, shadow: true }) 346e41f4b71Sopenharmony_ci }.width('100%').padding({ top: 5 }) 347e41f4b71Sopenharmony_ci } 348e41f4b71Sopenharmony_ci} 349e41f4b71Sopenharmony_ci``` 350e41f4b71Sopenharmony_ci 351e41f4b71Sopenharmony_ci 352e41f4b71Sopenharmony_ci### Example 3 353e41f4b71Sopenharmony_ci 354e41f4b71Sopenharmony_ciThis example shows the animation effect of the ring style progress indicator. 355e41f4b71Sopenharmony_ci 356e41f4b71Sopenharmony_ci```ts 357e41f4b71Sopenharmony_ci// xxx.ets 358e41f4b71Sopenharmony_ci@Entry 359e41f4b71Sopenharmony_ci@Component 360e41f4b71Sopenharmony_cistruct ProgressExample { 361e41f4b71Sopenharmony_ci private gradientColor: LinearGradient = new LinearGradient([{ color: Color.Yellow, offset: 0.5 }, 362e41f4b71Sopenharmony_ci { color: Color.Orange, offset: 1.0 }]) 363e41f4b71Sopenharmony_ci build() { 364e41f4b71Sopenharmony_ci Column({ space: 15 }) { 365e41f4b71Sopenharmony_ci Text('Loading Effect').fontSize(9).fontColor(0xCCCCCC).width('90%') 366e41f4b71Sopenharmony_ci Progress({ value: 0, total: 100, type: ProgressType.Ring }) 367e41f4b71Sopenharmony_ci .width(100).color(Color.Blue) 368e41f4b71Sopenharmony_ci .style({ strokeWidth: 20, status: ProgressStatus.LOADING }) 369e41f4b71Sopenharmony_ci 370e41f4b71Sopenharmony_ci Text('Scan Effect').fontSize(9).fontColor(0xCCCCCC).width('90%') 371e41f4b71Sopenharmony_ci Progress({ value: 30, total: 100, type: ProgressType.Ring }) 372e41f4b71Sopenharmony_ci .width(100).color(Color.Orange) 373e41f4b71Sopenharmony_ci .style({ strokeWidth: 20, enableScanEffect: true }) 374e41f4b71Sopenharmony_ci }.width('100%').padding({ top: 5 }) 375e41f4b71Sopenharmony_ci } 376e41f4b71Sopenharmony_ci} 377e41f4b71Sopenharmony_ci``` 378e41f4b71Sopenharmony_ci 379e41f4b71Sopenharmony_ci 380e41f4b71Sopenharmony_ci### Example 4 381e41f4b71Sopenharmony_ci 382e41f4b71Sopenharmony_ciThis example shows the effect of visual attributes of the capsule style progress indicator. 383e41f4b71Sopenharmony_ci 384e41f4b71Sopenharmony_ci```ts 385e41f4b71Sopenharmony_ci// xxx.ets 386e41f4b71Sopenharmony_ci@Entry 387e41f4b71Sopenharmony_ci@Component 388e41f4b71Sopenharmony_cistruct ProgressExample { 389e41f4b71Sopenharmony_ci 390e41f4b71Sopenharmony_ci build() { 391e41f4b71Sopenharmony_ci Column({ space: 15 }) { 392e41f4b71Sopenharmony_ci Row({ space: 40 }) { 393e41f4b71Sopenharmony_ci Progress({ value: 100, total: 100,type: ProgressType.Capsule }).width(100).height(50) 394e41f4b71Sopenharmony_ci .style({borderColor: Color.Blue, borderWidth: 1, content: 'Installing...', 395e41f4b71Sopenharmony_ci font: {size: 13, style: FontStyle.Normal}, fontColor: Color.Gray, 396e41f4b71Sopenharmony_ci enableScanEffect: false, showDefaultPercentage: false}) 397e41f4b71Sopenharmony_ci } 398e41f4b71Sopenharmony_ci }.width('100%').padding({ top: 5 }) 399e41f4b71Sopenharmony_ci } 400e41f4b71Sopenharmony_ci} 401e41f4b71Sopenharmony_ci``` 402e41f4b71Sopenharmony_ci 403e41f4b71Sopenharmony_ci 404e41f4b71Sopenharmony_ci### Example 5 405e41f4b71Sopenharmony_ci 406e41f4b71Sopenharmony_ciThis example shows the smooth effect. 407e41f4b71Sopenharmony_ci 408e41f4b71Sopenharmony_ci```ts 409e41f4b71Sopenharmony_ci// xxx.ets 410e41f4b71Sopenharmony_ci@Entry 411e41f4b71Sopenharmony_ci@Component 412e41f4b71Sopenharmony_cistruct Index { 413e41f4b71Sopenharmony_ci @State value: number = 0 414e41f4b71Sopenharmony_ci 415e41f4b71Sopenharmony_ci build() { 416e41f4b71Sopenharmony_ci Column({space: 10}) { 417e41f4b71Sopenharmony_ci Text('enableSmoothEffect: true').fontSize(9).fontColor(0xCCCCCC).width('90%').margin(5) 418e41f4b71Sopenharmony_ci .margin({top: 20}) 419e41f4b71Sopenharmony_ci Progress({value: this.value, total: 100, type:ProgressType.Linear}) 420e41f4b71Sopenharmony_ci .style({strokeWidth: 10, enableSmoothEffect: true}) 421e41f4b71Sopenharmony_ci 422e41f4b71Sopenharmony_ci Text('enableSmoothEffect: false').fontSize(9).fontColor(0xCCCCCC).width('90%').margin(5) 423e41f4b71Sopenharmony_ci Progress({value: this.value, total: 100, type:ProgressType.Linear}) 424e41f4b71Sopenharmony_ci .style({strokeWidth: 10, enableSmoothEffect: false}) 425e41f4b71Sopenharmony_ci 426e41f4b71Sopenharmony_ci Button('value +10').onClick(() => { 427e41f4b71Sopenharmony_ci this.value += 10 428e41f4b71Sopenharmony_ci }) 429e41f4b71Sopenharmony_ci .width(75) 430e41f4b71Sopenharmony_ci .height(15) 431e41f4b71Sopenharmony_ci .fontSize(9) 432e41f4b71Sopenharmony_ci } 433e41f4b71Sopenharmony_ci .width('50%') 434e41f4b71Sopenharmony_ci .height('100%') 435e41f4b71Sopenharmony_ci .margin({left:20}) 436e41f4b71Sopenharmony_ci } 437e41f4b71Sopenharmony_ci} 438e41f4b71Sopenharmony_ci 439e41f4b71Sopenharmony_ci``` 440e41f4b71Sopenharmony_ci 441e41f4b71Sopenharmony_ci 442e41f4b71Sopenharmony_ci### Example 6 443e41f4b71Sopenharmony_ci 444e41f4b71Sopenharmony_ciThis example implements a custom progress indicator featuring a star-shaped design. The total progress is set to **3**, and the current value can be incremented or decremented through buttons. The achieved progress is filled with a custom color. 445e41f4b71Sopenharmony_ci 446e41f4b71Sopenharmony_ci```ts 447e41f4b71Sopenharmony_ci// xxx.ets 448e41f4b71Sopenharmony_ciclass MyProgressModifier implements ContentModifier<ProgressConfiguration> { 449e41f4b71Sopenharmony_ci color: Color = Color.White 450e41f4b71Sopenharmony_ci 451e41f4b71Sopenharmony_ci 452e41f4b71Sopenharmony_ci constructor(color:Color) { 453e41f4b71Sopenharmony_ci this.color = color 454e41f4b71Sopenharmony_ci } 455e41f4b71Sopenharmony_ci applyContent() : WrappedBuilder<[ProgressConfiguration]> 456e41f4b71Sopenharmony_ci { 457e41f4b71Sopenharmony_ci return wrapBuilder(myProgress) 458e41f4b71Sopenharmony_ci } 459e41f4b71Sopenharmony_ci} 460e41f4b71Sopenharmony_ci 461e41f4b71Sopenharmony_ci@Builder function myProgress(config: ProgressConfiguration ) { 462e41f4b71Sopenharmony_ci 463e41f4b71Sopenharmony_ci Column({space:30}) { 464e41f4b71Sopenharmony_ci Text("Current progress: " + config.value + "/" + config.total).fontSize(20) 465e41f4b71Sopenharmony_ci Row() { 466e41f4b71Sopenharmony_ci Flex({ justifyContent: FlexAlign.SpaceBetween }) { 467e41f4b71Sopenharmony_ci Path() 468e41f4b71Sopenharmony_ci .width('30%') 469e41f4b71Sopenharmony_ci .height('30%') 470e41f4b71Sopenharmony_ci .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') 471e41f4b71Sopenharmony_ci .fill(config.enabled && config.value >=1 ? (config.contentModifier as MyProgressModifier).color : Color.White) 472e41f4b71Sopenharmony_ci .stroke(Color.Black) 473e41f4b71Sopenharmony_ci .strokeWidth(3) 474e41f4b71Sopenharmony_ci Path() 475e41f4b71Sopenharmony_ci .width('30%') 476e41f4b71Sopenharmony_ci .height('30%') 477e41f4b71Sopenharmony_ci .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') 478e41f4b71Sopenharmony_ci .fill(config.enabled && config.value >=2 ? (config.contentModifier as MyProgressModifier).color : Color.White) 479e41f4b71Sopenharmony_ci .stroke(Color.Black) 480e41f4b71Sopenharmony_ci .strokeWidth(3) 481e41f4b71Sopenharmony_ci Path() 482e41f4b71Sopenharmony_ci .width('30%') 483e41f4b71Sopenharmony_ci .height('30%') 484e41f4b71Sopenharmony_ci .commands('M108 0 L141 70 L218 78.3 L162 131 L175 205 L108 170 L41.2 205 L55 131 L1 78 L75 68 L108 0 Z') 485e41f4b71Sopenharmony_ci .fill(config.enabled && config.value >=3 ? (config.contentModifier as MyProgressModifier).color : Color.White) 486e41f4b71Sopenharmony_ci .stroke(Color.Black) 487e41f4b71Sopenharmony_ci .strokeWidth(3) 488e41f4b71Sopenharmony_ci }.width('100%') 489e41f4b71Sopenharmony_ci } 490e41f4b71Sopenharmony_ci }.margin({bottom:100}) 491e41f4b71Sopenharmony_ci} 492e41f4b71Sopenharmony_ci 493e41f4b71Sopenharmony_ci@Entry 494e41f4b71Sopenharmony_ci@Component 495e41f4b71Sopenharmony_cistruct Index { 496e41f4b71Sopenharmony_ci @State currentValue: number = 0 497e41f4b71Sopenharmony_ci modifier = new MyProgressModifier(Color.Red) 498e41f4b71Sopenharmony_ci @State myModifier:(MyProgressModifier | undefined) = this.modifier 499e41f4b71Sopenharmony_ci build() { 500e41f4b71Sopenharmony_ci Column() { 501e41f4b71Sopenharmony_ci Progress({ value: this.currentValue, total: 3, type: ProgressType.Ring}).contentModifier(this.modifier) 502e41f4b71Sopenharmony_ci Button('Progress++').onClick(()=>{ 503e41f4b71Sopenharmony_ci if (this.currentValue < 3) { 504e41f4b71Sopenharmony_ci this.currentValue += 1 505e41f4b71Sopenharmony_ci } 506e41f4b71Sopenharmony_ci }).width('30%') 507e41f4b71Sopenharmony_ci Button('addProgress--').onClick(()=>{ 508e41f4b71Sopenharmony_ci if (this.currentValue > 0) { 509e41f4b71Sopenharmony_ci this.currentValue -= 1 510e41f4b71Sopenharmony_ci } 511e41f4b71Sopenharmony_ci }).width('30%') 512e41f4b71Sopenharmony_ci }.width('100%').height('100%') 513e41f4b71Sopenharmony_ci } 514e41f4b71Sopenharmony_ci} 515e41f4b71Sopenharmony_ci 516e41f4b71Sopenharmony_ci``` 517e41f4b71Sopenharmony_ci 518e41f4b71Sopenharmony_ci 519e41f4b71Sopenharmony_ci### Example 7 520e41f4b71Sopenharmony_ci 521e41f4b71Sopenharmony_ciThis example shows how to enable privacy mode, which requires widget framework support. 522e41f4b71Sopenharmony_ci 523e41f4b71Sopenharmony_ci```ts 524e41f4b71Sopenharmony_ci@Entry 525e41f4b71Sopenharmony_ci@Component 526e41f4b71Sopenharmony_cistruct ProgressExample { 527e41f4b71Sopenharmony_ci build() { 528e41f4b71Sopenharmony_ci Scroll() { 529e41f4b71Sopenharmony_ci Column({ space: 15 }) { 530e41f4b71Sopenharmony_ci Row() { 531e41f4b71Sopenharmony_ci Progress({ value: 50, total: 100, type: ProgressType.Capsule }).width(100).height(50) 532e41f4b71Sopenharmony_ci .style({ 533e41f4b71Sopenharmony_ci borderColor: Color.Blue, 534e41f4b71Sopenharmony_ci borderWidth: 1, 535e41f4b71Sopenharmony_ci content: 'Installing...', 536e41f4b71Sopenharmony_ci font: { size: 13, style: FontStyle.Normal }, 537e41f4b71Sopenharmony_ci fontColor: Color.Gray, 538e41f4b71Sopenharmony_ci enableScanEffect: false, 539e41f4b71Sopenharmony_ci showDefaultPercentage: true 540e41f4b71Sopenharmony_ci }) 541e41f4b71Sopenharmony_ci .privacySensitive(true) 542e41f4b71Sopenharmony_ci } 543e41f4b71Sopenharmony_ci } 544e41f4b71Sopenharmony_ci } 545e41f4b71Sopenharmony_ci } 546e41f4b71Sopenharmony_ci} 547e41f4b71Sopenharmony_ci``` 548e41f4b71Sopenharmony_ci 549