1# Enable/Disable
2
3The **enabled** attribute sets whether a component responds to user interactions, such as [click events](ts-universal-events-click.md), [touch events](ts-universal-events-touch.md), [drag events](ts-universal-events-drag-drop.md), [key events](ts-universal-events-key.md), [focus events](ts-universal-focus-event.md), and [mouse events](ts-universal-mouse-key.md).
4
5>  **NOTE**
6>
7>  The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
8>
9>  The **enabled** attribute takes effect only when the component is pressed. It does not work when the component is interacting with the user.
10
11## enabled
12
13enabled(value: boolean)
14
15Sets whether the component responds to user interactions.
16
17**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets.
18
19**Atomic service API**: This API can be used in atomic services since API version 11.
20
21**System capability**: SystemCapability.ArkUI.ArkUI.Full
22
23**Parameters**
24
25| Name| Type   | Mandatory| Description                                                        |
26| ------ | ------- | ---- | ------------------------------------------------------------ |
27| value  | boolean | Yes  | Whether the component responds to user interactions, including clicks and touches. The value **true** means that the component responds to user interactions, and **false** means the opposite.<br>Default value: **true**|
28
29
30## Example
31
32```ts
33// xxx.ets
34@Entry
35@Component
36struct EnabledExample {
37  
38  build() {
39    Flex({ justifyContent: FlexAlign.SpaceAround }) {
40      // The component does not respond to clicks.
41      Button('disable').enabled(false).backgroundColor(0x317aff).opacity(0.4)
42      Button('enable').backgroundColor(0x317aff)
43    }
44    .width('100%')
45    .padding({ top: 5 })
46  }
47}
48```
49
50![en-us_image_0000001212218428](figures/en-us_image_0000001212218428.gif)
51