1e41f4b71Sopenharmony_ci# Accessibility 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciYou can set accessibility attributes and events for components. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> The APIs of this module are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## Attributes 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci| Name| Type| Default Value| Description| 12e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | 13e41f4b71Sopenharmony_ci| accessibilitygroup | boolean | false | Accessibility group. If this attribute is set to **true**, the component and all its child components form an entire selectable component, and the accessibility service will no longer be available for the content of its child components.| 14e41f4b71Sopenharmony_ci| accessibilitytext | string | - | Accessibility text. If a component does not contain text information, it will not be read when the component is selected by the screen reader. In this case, the screen reader user cannot know which component is selected. To solve this problem, you can set this attribute for components without text information. When the component is selected by the screen reader, the specified accessibility text will be read, informing the user which component is selected. If a component with this attribute set contains text information, only the accessibility text will be read.| 15e41f4b71Sopenharmony_ci| accessibilitydescription | string | - | Accessibility description. You can specify further explanation of the current component, for example, possible operation consequences, especially those that cannot be learned from component attributes and accessibility text. You can set a detailed description text for the attribute of the component to help users understand the operation to be performed. If a component contains both text information and the accessibility description, the text is read first and then the accessibility description, when the component is selected.| 16e41f4b71Sopenharmony_ci| accessibilityimportance | string | auto | Accessibility importance, which is used to decide whether a component can be identified by the accessibility service. The value can be **auto**, **yes**, **no**, or **no-hide-descendants**. The last value forces the screen reader to ignore the current component and all its subcomponents.<br>**yes**: The current component is selectable for the accessibility service.<br>**no**: The current component cannot be selected for the barrier-free auxiliary service. | 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci- accessibilitygroup 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ci ```html 21e41f4b71Sopenharmony_ci <div accessibilitygroup="true"> 22e41f4b71Sopenharmony_ci <text>text1</text> 23e41f4b71Sopenharmony_ci <text>text2</text> 24e41f4b71Sopenharmony_ci </div> 25e41f4b71Sopenharmony_ci ``` 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci- accessibilitytext 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci ```html 30e41f4b71Sopenharmony_ci <image src="common/image/barrierfree.jpg" accessibilitytext=" This is a landscape image. "></image> 31e41f4b71Sopenharmony_ci ``` 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci- accessibilitydescription 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci ```html 36e41f4b71Sopenharmony_ci <button accessibilitydescription="Click to open a dialog box." onclick="DialogShow">Show dialog</button> 37e41f4b71Sopenharmony_ci ``` 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci- accessibilityimportance 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ci In the following **accessibilityImportance** example, **\<div>** and **\<text>** are not selected by the accessibility service. To select a component that is unselected by default, add **accessibilityimportance="yes"** to the component. 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci ```html 45e41f4b71Sopenharmony_ci <div accessibilityimportance="no-hide-descendants"> 46e41f4b71Sopenharmony_ci <text>text</text> 47e41f4b71Sopenharmony_ci </div> 48e41f4b71Sopenharmony_ci ``` 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ci## Accessibility Events 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci| Name| Parameter| Description| 54e41f4b71Sopenharmony_ci| -------- | -------- | -------- | 55e41f4b71Sopenharmony_ci| accessibility | AbilityEvent | Event dispatched by the accessibility service.| 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ci **Table 1** AbilityEvent attributes 58e41f4b71Sopenharmony_ci 59e41f4b71Sopenharmony_ci| Name| Type| Description| 60e41f4b71Sopenharmony_ci| -------- | -------- | -------- | 61e41f4b71Sopenharmony_ci| eventType | number | Event type.<br>- **0**: custom event.<br>- **1**: accessibility focus.<br>- **2**: clear accessibility focus<br>For non-focus-related events dispatched by the accessibility system, the **eventType** value is **0**. For onfocus events dispatched by the accessibility system, the **eventType** value is **1**. For onblur events dispatched by the accessibility system, the **eventType** value is **2**. | 62e41f4b71Sopenharmony_ci| param | Object | Parameter that accessibility applications need to pass when sending custom events. | 63