Deprecation notice:
installation.autoAdd is deprecated. If your code still uses this property, update it to installation.staticContainer.
Learn more about custom element installation in the CLI.
When you create a custom element with the Wix CLI, you can control how site builders interact with it in the editor. These settings are defined in your widget's element.extension.ts file and determine things like default dimensions and whether the widget is added automatically on install.
You can configure the following settings in your widget's element.extension.ts file. Available settings include the widget's dimensions, installation behavior, and dashboard page association.
Control the widget's initial size and whether site builders can stretch it to full width:
| Setting | Description |
|---|---|
width.defaultWidth | The widget's width in pixels when first installed on a site. |
width.allowStretch | Whether to allow site builders to toggle the widget between full-width and default width. |
width.stretchByDefault | Whether to stretch the widget to full width on installation. |
height.defaultHeight | The widget's height in pixels when first installed on a site. |
Control how the widget is added to a site when your app is installed:
| Setting | Description |
|---|---|
installation.staticContainer | Determines where the widget is automatically added when your app is installed. Set to "HOMEPAGE" to automatically add the widget to the site home page upon installation. If you omit the field, the widget isn't added upon install. |
For more details and best practices, see About Custom Element Installation with the CLI.
Associate a widget with one of your app's dashboard pages. When configured, a Manage button appears in the widget's action bar in the editor, allowing site builders to navigate directly to the linked dashboard page.
Set dashboardPageComponentId to the id of the dashboard page extension you want to associate with the widget.