Elements

Alpha: Editor React Components are currently in alpha. This feature is subject to change and may have bugs, issues, and limitations. We're actively improving it based on your feedback.

The elements property lets you make inner parts of your component independently selectable and configurable in the editor. Each element gets its own selector, display name, and optional data, styling, states, and actions. When a Wix user clicks on that part of your component, they see controls specific to it rather than the whole component.

For example, a product card with a title, image, and buy button could define each part as a separate element. Clicking the button in the editor opens controls for just that button, such as its text, link, colors, and states, without affecting the rest of the card.

Where to define

You can define elements in editorElement and in other elements of type inlineElement.

Important: Elements can nest multiple levels deep. When an element defines data, those values are passed to your component inside the elementProps object rather than as top-level props. Nested elements appear under their parent's elementProps. For more information, see Props.

Element item

Each entry in the elements map is an element item. It specifies the element's type and contains the corresponding configuration object.

elementTypestringRequired

The element type. Supported values: inlineElement or refElement. Only inlineElement is currently supported.


inlineElementInlineElement

Configuration for the element when elementType is 'inlineElement'.


refElementRefElement

Configuration for the element when elementType is 'refElement'. Not yet supported.

Inline element

An inline element is a custom element you define from scratch with its complete configuration.

selectorstringRequired

CSS selector targeting the element in your component's DOM.


displayNamestringRequired

Name shown in the editor.


datamap<string, DataItem>

Data properties for this element, passed as props to your component.


elementsmap<string, ElementItem>

Nested child elements in this element.


behaviorsBehaviors

Controls editor interactions.


actionsActions

Native platform actions available for this element.


customActionsmap<string, CustomAction>

Developer-defined custom actions specific to your component.


presetsmap<string, PresetItem>

Predefined style or layout variations.


archetypeArchetype

Semantic classification hint for AI and editor features.


statesmap<string, ElementState>

Define component states for preview and testing.


visibleStateVisibleState

Links element visibility to a component state for conditional display.


displayFiltersDisplayFilters

Control visibility of properties in the editor panel.


displayGroupsmap<string, DisplayGroupItem>

Group related properties together in the editor panel for better UX.


cssPropertiesmap<string, CssPropertyItem>

Direct CSS properties applied to the element.


cssCustomPropertiesmap<string, CssCustomPropertyItem>

CSS custom properties declared with names prefixed by `--`, for reusable values referenced with `var()`.


helpArticle{ url: string }

Link to a help article for this element. Set `url` to the full URL of the help article.

Ref element

Caution: Support for ref elements is under development. See Unsupported features.

A ref element references an existing Wix component and optionally overrides its properties.

typestringRequired

The type identifier of the Wix component to reference.


selectorstringRequired

CSS selector for where this element appears in your DOM.


displayNamestring

Override the referenced component's display name in the editor.


datamap<string, PropertyOverride>

Override how data properties are displayed or disable their editing.


behaviorsBehaviors

Override the referenced component's editor behaviors.


actionsActions

Override or hide native actions from the referenced component.


customActionsmap<string, CustomAction>

Override custom actions from the referenced component.


visibleStateVisibleState

Links element visibility to a component state for conditional display.


displayFiltersDisplayFilters

Control visibility of properties in the editor panel.


cssPropertiesmap<string, PropertyOverride>

Override how CSS properties are displayed or disable their editing.


cssCustomPropertiesmap<string, PropertyOverride>

Override how CSS custom properties are displayed or disable their editing.


helpArticle{ url: string }

Link to a help article for this element. Set `url` to the full URL of the help article.

Examples

Progress bar with nested elements

A progress bar with CSS custom properties and non-selectable sub-elements.

Copy

Removable element with display toggle

A button component with a removable icon element. Setting removable: true lets Wix users toggle the element on or off. The display CSS property with displayValues controls which display states are available when the element is visible.

Copy

See also

Did this help?