Site Plugin Extension Files and Code

When you add a site plugin extension, the generated files land under src/extensions/site/plugins/<plugin-folder>/, a logo file lands in the project's public/ folder, and the extension is registered in your project's extensions.ts.

This file set is the same whether you add the plugin in a Studio Two site project or in a Wix CLI app.

Copy
FileWhat it's for
<plugin-folder>.extension.tsThe configuration file for the plugin ID, name, slots, tag name, and file paths.
<plugin-folder>.tsxThe custom element that renders in the slot.
<plugin-folder>.panel.tsxThe settings panel, a React component where a Wix user customizes the plugin in the editor.
<plugin-folder>-logo.svgThe plugin's logo, referenced by marketData.logoUrl in the configuration file.

Configuration file

The <plugin-folder>.extension.ts file declares the plugin with extensions.sitePlugin().

Import extensions from the package your project uses:

Copy
Copy

The following example declares a plugin named Checkout Banner for the Checkout page's checkout:top slot:

Copy

Keep this file. If you add a site plugin yourself, include it. Don't delete it after the plugin is generated.

Configuration fields

FieldTypeDescription
idstringPlugin ID as a GUID. It must be unique across all extensions in the project.
namestringThe plugin's name.
marketDataobjectOptional. How the plugin is presented to Wix users.
marketData.namestringThe plugin name that Wix users see.
marketData.descriptionstringThe plugin description that Wix users see.
marketData.logoUrlstringURL of the plugin's logo. The generated value points to the logo file in the project's public/ folder. If you rename that file, update this value. If you delete it, remove this field.
placementsarrayThe slots the plugin can fill. The generated file lists the slot you chose. Add an object for each other slot the plugin can fill. For each widget's appDefinitionId, widgetId, and slotId values, see the Legacy placements values section of the widget's page in About Slots. extensions.sitePlugin() doesn't accept the placementsSlotIds array that those pages recommend.
placements.appDefinitionIdstringID of the Wix app that owns the widget, such as Wix eCommerce.
placements.widgetIdstringID of the widget that contains the slot, such as the Checkout page.
placements.slotIdstringID of the slot in that widget, such as checkout:top.
installation.autoAddbooleanFor a plugin in an app, whether Wix adds the plugin to the first available slot in placements when a Wix user installs the app. Automatic placement might not work in some slots, such as the Checkout and Side Cart slots. Their pages in About Slots say so.
tagNamestringThe custom element's tag name. It must follow the custom element naming rules: lowercase, with at least one hyphen. A generated plugin uses the plugin folder name.
elementstringPath to the custom element file, relative to the project's src/ directory.
settingsstringPath to the settings panel file, relative to the project's src/ directory.

Custom element

The <plugin-folder>.tsx file defines the plugin as a custom element: a class that extends HTMLElement. The class must be the file's default export. Wix registers it under the configuration's tagName.

A generated plugin renders a title from its display-name attribute, and renders again when the attribute changes:

Copy

You can write code in other files and import it into this file.

Slot data

A slot can pass data to the plugin through its plugin API, such as the ID of the product in view. Wix sets each plugin API property and function on the element as a JavaScript property with the same name. Wix also sets each plugin API property as an attribute:

  • The attribute name is the property name in kebab case. For example, productId becomes product-id.
  • A value that isn't a primitive arrives as a JSON string. Use JSON.parse() to read it.

To read an attribute, list it in observedAttributes and handle it in attributeChangedCallback(), the same way the generated element reads display-name. To receive a function, use a setter. For the setter pattern, see Connect to the plugin's API.

For the plugin API of each slot, see About Slots.

Note: The screenshots and slot locations in About Slots and its widget pages might not match every Wix editor. In some editors, a widget and its slots might look different, or not exist.

Settings panel

The <plugin-folder>.panel.tsx file exports a React component, the plugin's settings panel. A Wix user opens it in the editor to customize the plugin.

The panel reads and sets the plugin's properties with the Widget API from @wix/editor. Each property is bound to an attribute of the custom element, so a change in the panel updates the element. A generated panel has a single Display Name field for the display-name property:

Copy

Inside the panel you can use the Wix Design System for the panel's UI and the Wix JavaScript SDK to access Wix data.

See also

Last updated: 2 November 2026

Did this help?