1e41f4b71Sopenharmony_ci# AbilityComponent (System API) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci**AbilityComponent** is a container for independently displaying an ability. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> This component is deprecated since API version 10. You are advised to use [\<UIExtensionComponent>](ts-container-ui-extension-component-sys.md) instead. 8e41f4b71Sopenharmony_ci> 9e41f4b71Sopenharmony_ci> This component is supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version. 10e41f4b71Sopenharmony_ci> 11e41f4b71Sopenharmony_ci> The APIs provided by this component are system APIs. 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci## Constraints 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci**AbilityComponent** is rendered independently and cannot be overlaid with other display content. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci**AbilityComponent** cannot process input events. Events are directly distributed to the internal ability for processing without passing through the current ability. 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ciOnly width and height can be set for **AbilityComponent**. These attributes are mandatory and cannot be dynamically updated. 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ciThe ability to be started must inherit from [WindowExtension](../js-apis-application-windowExtensionAbility-sys.md). 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci## Child Components 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ciNot supported 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci## APIs 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ciAbilityComponent(want: Want) 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci**Parameters** 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 35e41f4b71Sopenharmony_ci| ------ | ---------------------------------------------------------- | ---- | ----------------------- | 36e41f4b71Sopenharmony_ci| want | [Want](../../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Description of the default ability to load.| 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci## Events 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ci### onConnect 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_cionConnect(callback:() => void) 44e41f4b71Sopenharmony_ci 45e41f4b71Sopenharmony_ciCalled when this **AbilityComponent** is started. You can then use APIs in the **AbilityComponent**. 46e41f4b71Sopenharmony_ci 47e41f4b71Sopenharmony_ci### onDisconnect 48e41f4b71Sopenharmony_ci 49e41f4b71Sopenharmony_cionDisconnect(callback:() => void) 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ciCalled when this **AbilityComponent** is destroyed. 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci## Example 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci```ts 56e41f4b71Sopenharmony_ci// xxx.ets 57e41f4b71Sopenharmony_ci@Entry 58e41f4b71Sopenharmony_ci@Component 59e41f4b71Sopenharmony_cistruct MyComponent { 60e41f4b71Sopenharmony_ci 61e41f4b71Sopenharmony_ci build() { 62e41f4b71Sopenharmony_ci Column() { 63e41f4b71Sopenharmony_ci AbilityComponent({ 64e41f4b71Sopenharmony_ci want: { 65e41f4b71Sopenharmony_ci bundleName: '', 66e41f4b71Sopenharmony_ci abilityName: '' 67e41f4b71Sopenharmony_ci }, 68e41f4b71Sopenharmony_ci }) 69e41f4b71Sopenharmony_ci .onConnect(() => { 70e41f4b71Sopenharmony_ci console.log('AbilityComponent connect') 71e41f4b71Sopenharmony_ci }) 72e41f4b71Sopenharmony_ci .onDisconnect(() => { 73e41f4b71Sopenharmony_ci console.log('AbilityComponent disconnect') 74e41f4b71Sopenharmony_ci }) 75e41f4b71Sopenharmony_ci } 76e41f4b71Sopenharmony_ci } 77e41f4b71Sopenharmony_ci} 78e41f4b71Sopenharmony_ci``` 79