setProp()

Sets the value of the specified widget property.

Syntax

Copy
function setProp(propName: string, value: string): Promise<void>

Parameters

NameTypeDescription
propNamestringName of the property that you want to set.
valuestringValue of the property that you want to set.

Returns

Promise<void>

Example

Copy
import { editor, widget } from "@wix/editor"; import { createClient } from "@wix/sdk"; const client = createClient({ host: editor.host(), modules: { widget }, }); async function setWidgetProp(propName, value) { const response = await client.widget.setProp(propName, value); }
Did this help?