> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: About Widget Code in Blocks ## Article: About the Widget Code ## Article Link: https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/code-in-blocks/about-widget-code-in-blocks.md ## Article Content: # About Widget Code in Blocks
**Editor compatibility** Wix Blocks apps aren't supported in the Wix Harmony editor. Existing Blocks apps remain available for purchase on the Wix App Market for Wix Editor and Wix Studio sites. To learn more, see [About Wix Harmony and Blocks](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/about-wix-harmony-and-blocks.md).Widget code lets you add custom functionality to your widget and expose an external API. ## What widget code is used for Add code to your widget to provide the following: * **Custom functionality and interactions**. Select widget elements using their IDs and bind them to code, work with Wix's frontend and backend APIs, and more. * **Widget API**. Your [widget API](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/widget-api/about-the-widget-api.md) lets you add properties, functions and events to the entire widget. These are exposed in the editor when your widget is installed on a site, or when it's nested inside another widget. ## Where to write widget code Where you add your widget code varies according to the tools you are using. ### Add widget code in the Blocks Editor If you are working directly in the Blocks editor: - Make sure you selected the correct widget in the **App Interface** > **Widgets** panel. - Write your widget logic in the code panel in the bottom part of your screen. - Click the **Widget API**  icon to add API properties, functions and events. - You can also ask the [Blocks AI](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/get-started/about-the-blocks-ai.md) to generate the widget code for you.  ### Add widget code in the Wix IDE for Blocks If you are using the [Wix IDE for Blocks](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/code-in-blocks/about-the-wix-ide-for-blocks.md), add your widget code in the following locations: - Write the widget code in the `site` folder in the auto-generated file that has your widget's name. - Click the **Widget API**  icon to add API properties, functions and events. ### Add widget code in the Blocks-CLI integration
**Important:** The Blocks-CLI integration only works with the [Wix CLI for Apps](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/about-the-wix-cli-for-apps.md). The new [Wix CLI](https://dev.wix.com/docs/wix-cli/guides/about-the-wix-cli.md), which is the recommended tool for new app projects, doesn’t support this integration.If you are using the [Blocks-CLI integration](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/code-in-blocks/about-the-blocks-cli-integration-for-widgets.md), add your widget code in the following files: - Write widget logic in the [`widget.ts`](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/blocks-site-widgets/widget-files-and-code.md#widgetts) file. - Write widget API properties, events and functions in the [`api.ts`](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/blocks-site-widgets/widget-files-and-code.md#apits) file.