1e41f4b71Sopenharmony_ci# Visibility 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe visibility attribute controls whether a component is visible. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> This event is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## visibility 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_civisibility(value: Visibility) 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ciSets the visibility of this component. 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci**Parameters** 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 24e41f4b71Sopenharmony_ci| ------ | --------------------------------------------- | ---- | ------------------------------------------------------------ | 25e41f4b71Sopenharmony_ci| value | [Visibility](ts-appendix-enums.md#visibility) | Yes | Whether the component is visible. When appropriate, consider using [conditional rendering](../../../quick-start/arkts-rendering-control-ifelse.md) as a substitute.<br>Default value: **Visibility.Visible**| 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci## Example 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci```ts 31e41f4b71Sopenharmony_ci// xxx.ets 32e41f4b71Sopenharmony_ci@Entry 33e41f4b71Sopenharmony_ci@Component 34e41f4b71Sopenharmony_cistruct VisibilityExample { 35e41f4b71Sopenharmony_ci build() { 36e41f4b71Sopenharmony_ci Column() { 37e41f4b71Sopenharmony_ci Column() { 38e41f4b71Sopenharmony_ci // The component is hidden and does not take up space in the layout. 39e41f4b71Sopenharmony_ci Text('None').fontSize(9).width('90%').fontColor(0xCCCCCC) 40e41f4b71Sopenharmony_ci Row().visibility(Visibility.None).width('90%').height(80).backgroundColor(0xAFEEEE) 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci // The component is hidden but takes up space in the layout. 43e41f4b71Sopenharmony_ci Text('Hidden').fontSize(9).width('90%').fontColor(0xCCCCCC) 44e41f4b71Sopenharmony_ci Row().visibility(Visibility.Hidden).width('90%').height(80).backgroundColor(0xAFEEEE) 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci // The component is visible, which is the default display mode. 47e41f4b71Sopenharmony_ci Text('Visible').fontSize(9).width('90%').fontColor(0xCCCCCC) 48e41f4b71Sopenharmony_ci Row().visibility(Visibility.Visible).width('90%').height(80).backgroundColor(0xAFEEEE) 49e41f4b71Sopenharmony_ci }.width('90%').border({ width: 1 }) 50e41f4b71Sopenharmony_ci }.width('100%').margin({ top: 5 }) 51e41f4b71Sopenharmony_ci } 52e41f4b71Sopenharmony_ci} 53e41f4b71Sopenharmony_ci``` 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci 56