The context section of a context provider manifest declares the values and functions that the provider exposes through editor binding. It contains an items map where each key names an exposed item.
The following context exposes a value and a function:
A context item supports the following fields:
| Field | Required | Description |
|---|---|---|
dataType | Yes | Type of value or function that the item exposes. |
displayName | No | Item name shown in the editor. Maximum 100 characters. |
description | No | What the item holds or does. Maximum 300 characters. |
arrayItems | When dataType is arrayItems | Definition for each element in an array. |
data | When dataType is data | Fields in a nested object. |
function | When dataType is function | Parameters and return type of a function. |
textEnum | When dataType is textEnum | Allowed string options. |
Context items can't use the schema or container data types, or the deprecated event handler data types, such as onClick.
For an array, set dataType to arrayItems and define each element under arrayItems.item:
Warning: Arrays in context use arrayItems.item. Arrays in data use arrayItems.dataItem.
For a list of records, such as products or teammates, set arrayItems.item to a data item and declare the fields of each record. Declare only the fields that elements use, in the form they display them, rather than the full object that an API returns:
The provider component supplies an array of objects with the same keys. To go with the list, expose any functions that act on it, such as selectTeammate, as separate items.
For a nested object, set dataType to data and define its fields under data.items:
For a fixed set of strings, set dataType to textEnum and list the choices under textEnum.options:
For a function, set dataType to function and describe its signature under function.
| Field | Required | Description |
|---|---|---|
parameters | No | Up to 10 parameter definitions. Omit this field for a function with no parameters. |
returns | No | Return type definition. Omit this field for a function with no response. It can't be a DOM event, or use the data types that parameters can't use. |
async | No | Whether the function returns a Promise. Defaults to false. |
displayName | No | Function name shown in the editor. Maximum 100 characters. |
description | No | Function description shown in the editor. Maximum 300 characters. |
For example, the following function takes an ID and an optional quantity:
Each function parameter supports the following fields:
| Field | Required | Description |
|---|---|---|
dataType | Exactly one of dataType and domEvent | Type of value the parameter accepts. It can't be schema, container, or a deprecated event handler type, such as onClick. For an element event, use domEvent instead. |
domEvent | Exactly one of dataType and domEvent | Category of DOM event, such as a click, that marks the parameter as the event the function handles. See Event parameters. |
displayName | No | Parameter name shown in the editor. Maximum 100 characters. |
description | No | Parameter description shown in the editor. Maximum 100 characters. |
optional | No | Whether the parameter is optional. Only trailing parameters can be optional. |
defaultValue | No | Default shown in the editor when optional is true. The provider code must handle a missing value. |
arrayItems | When dataType is arrayItems | Definition for each array element. |
data | When dataType is data | Fields in a nested object. |
textEnum | When dataType is textEnum | Allowed string options. |
function | When dataType is function | Parameters and return type of a callback parameter. |
link | When dataType is link | Configuration for a link parameter, such as supported link types. |
changeEvent | No | The kind of input that triggers a CHANGE event. Used only when domEvent is CHANGE. |
Context functions and function library functions use the same parameter fields.
Many Wix elements accept rich text through editor binding. To expose formatted text, set dataType to richText and provide a RichText object at runtime:
For the runtime shape, see Context Provider Data Types.
Last updated: 5 November 2026