setProp()

Sets the value of the specified widget property. Use this function in the widget's settings panel code.

For widgets built with a self-managed custom element, properties are bound to the element's attributes. Updating a widget property triggers the custom element's attributeChangedCallback() function.

Syntax

Copy

Parameters

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

Returns

Promise<void>

Notes:

  • The promise returned by setProp() resolves when the editor has accepted the write. It doesn't guarantee the value is already committed on the selected widget, or that the custom element on the canvas has received the corresponding attribute yet.
  • If your settings panel writes several properties in a row, or rapid UI events trigger several updates, later writes can overwrite earlier ones that are still pending. Serialize writes: await each setProp() call before starting the next one, and confirm each value with getProp() before the next write.

Example

Copy

Last updated: 25 August 2026

Did this help?