目录

Quickly Inserting Scenario-based Code Snippets

DevEco Studio features Kit Assistant, which allows you to insert basic scenario-based components and code snippets into ArkTS projects via drag-and-drop, reducing the time spent writing boilerplate code.

  1. Choose View > Tool Windows > Kit Assistant on the menu bar or press Alt+K (Option+K on macOS) to access the Kit Assistant page.

  2. On the Kit Assistant page, browse the directory on the left to find and view scenario-based components and code snippets provided by different kits. The pane on the right displays detailed information of the selected item, including the usage constraints and applicable scenario.

  3. Drag the required component or functional code from the directory to the desired location within your .ets file.

    Kit Assistant may disable features or components that are not compatible with your current module or project settings, such as unsupported devices, API versions, or project models, or if they are not applicable to atomic services.