1# Obscuring
2
3When needed, you can obscure content of a component.
4
5>  **NOTE**
6>
7> The APIs of this module are supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version.
8
9## obscured
10
11obscured(reasons: Array<ObscuredReasons>)
12
13Sets how the component content is obscured.
14
15**Atomic service API**: This API can be used in atomic services since API version 11.
16
17**System capability**: SystemCapability.ArkUI.ArkUI.Full
18
19**Parameters**
20
21
22| Name| Type                                    | Mandatory                                  | Description                                 |
23| -----| ------------------------------------------ | ------------------------------------ | ------------------------------------ |
24| 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.|
25
26## Example
27
28```ts
29// xxx.ets
30@Entry
31@Component
32struct ObscuredExample {
33  build() {
34    Row() {
35      Column() {
36        Text('Text not set obscured attribute').fontSize(10).fontColor(Color.Black)
37        Text('This is an example for text obscured attribute.')
38          .fontSize(30)
39          .width('600px')
40          .fontColor(Color.Black)
41          .border({ width: 1 })
42        Text('Image not set obscured attribute').fontSize(10).fontColor(Color.Black)
43        Image($r('app.media.icon'))
44          .width('200px')
45          .height('200px')
46        Text('Text set obscured attribute').fontSize(10).fontColor(Color.Black)
47        Text('This is an example for text obscured attribute.')
48          .fontSize(30)
49          .width('600px')
50          .fontColor(Color.Black)
51          .border({ width: 1 })
52          .obscured([ObscuredReasons.PLACEHOLDER])
53        Text('Image set obscured attribute').fontSize(10).fontColor(Color.Black)
54        Image($r('app.media.icon'))
55          .width('200px')
56          .height('200px')
57          .obscured([ObscuredReasons.PLACEHOLDER])
58      }
59      .width('100%')
60    }
61    .height('100%')
62  }
63}
64```
65
66![obscured](figures/obscured.png)
67