1e41f4b71Sopenharmony_ci# Obscuring
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciWhen needed, you can obscure content of a component.
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci>  **NOTE**
6e41f4b71Sopenharmony_ci>
7e41f4b71Sopenharmony_ci> The APIs of this module are supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version.
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci## obscured
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ciobscured(reasons: Array<ObscuredReasons>)
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ciSets how the component content is obscured.
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11.
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci**Parameters**
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_ci| Name| Type                                    | Mandatory                                  | Description                                 |
23e41f4b71Sopenharmony_ci| -----| ------------------------------------------ | ------------------------------------ | ------------------------------------ |
24e41f4b71Sopenharmony_ci| reasons | Array<[ObscuredReasons](ts-appendix-enums.md#obscuredreasons10)> | Yes| How the component content is obscured.<br>Default value: **[]**<br>This API is supported in ArkTS widgets.<br>This API only works for the [Image](ts-basic-components-image.md)<!--Del-->, [Formcompnent](ts-basic-components-formcomponent-sys.md)<sup>12+</sup>,<!--DelEnd--> and [Text](ts-basic-components-text.md) components.<br>**NOTE**<br>To obscure an image when it is being loaded, you must set the width and height of the **Image** component.<br>Obscuring is not available for **Text** components that have child components or have any [styled string](ts-universal-styled-string.md#styled-string) configured.|
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci## Example
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ci```ts
29e41f4b71Sopenharmony_ci// xxx.ets
30e41f4b71Sopenharmony_ci@Entry
31e41f4b71Sopenharmony_ci@Component
32e41f4b71Sopenharmony_cistruct ObscuredExample {
33e41f4b71Sopenharmony_ci  build() {
34e41f4b71Sopenharmony_ci    Row() {
35e41f4b71Sopenharmony_ci      Column() {
36e41f4b71Sopenharmony_ci        Text('Text not set obscured attribute').fontSize(10).fontColor(Color.Black)
37e41f4b71Sopenharmony_ci        Text('This is an example for text obscured attribute.')
38e41f4b71Sopenharmony_ci          .fontSize(30)
39e41f4b71Sopenharmony_ci          .width('600px')
40e41f4b71Sopenharmony_ci          .fontColor(Color.Black)
41e41f4b71Sopenharmony_ci          .border({ width: 1 })
42e41f4b71Sopenharmony_ci        Text('Image not set obscured attribute').fontSize(10).fontColor(Color.Black)
43e41f4b71Sopenharmony_ci        Image($r('app.media.icon'))
44e41f4b71Sopenharmony_ci          .width('200px')
45e41f4b71Sopenharmony_ci          .height('200px')
46e41f4b71Sopenharmony_ci        Text('Text set obscured attribute').fontSize(10).fontColor(Color.Black)
47e41f4b71Sopenharmony_ci        Text('This is an example for text obscured attribute.')
48e41f4b71Sopenharmony_ci          .fontSize(30)
49e41f4b71Sopenharmony_ci          .width('600px')
50e41f4b71Sopenharmony_ci          .fontColor(Color.Black)
51e41f4b71Sopenharmony_ci          .border({ width: 1 })
52e41f4b71Sopenharmony_ci          .obscured([ObscuredReasons.PLACEHOLDER])
53e41f4b71Sopenharmony_ci        Text('Image set obscured attribute').fontSize(10).fontColor(Color.Black)
54e41f4b71Sopenharmony_ci        Image($r('app.media.icon'))
55e41f4b71Sopenharmony_ci          .width('200px')
56e41f4b71Sopenharmony_ci          .height('200px')
57e41f4b71Sopenharmony_ci          .obscured([ObscuredReasons.PLACEHOLDER])
58e41f4b71Sopenharmony_ci      }
59e41f4b71Sopenharmony_ci      .width('100%')
60e41f4b71Sopenharmony_ci    }
61e41f4b71Sopenharmony_ci    .height('100%')
62e41f4b71Sopenharmony_ci  }
63e41f4b71Sopenharmony_ci}
64e41f4b71Sopenharmony_ci```
65e41f4b71Sopenharmony_ci
66e41f4b71Sopenharmony_ci![obscured](figures/obscured.png)
67