getProp()

Gets the value of the specified widget property.

For widgets built with a self-hosted custom element, properties are bound to the element's attributes.

Syntax

Copy
function getProp(propName: string): Promise<string>

Parameters

NameTypeDescription
propNamestringName of the property that you want to get.

Returns

Promise<string>

Value of the property.

Example

Copy
import { widget } from "@wix/editor"; async function getWidgetProp(propName) { const response = await widget.getProp(propName); }
Did this help?