setProps( )


Sets the widget's properties. You can also assign a partial subset of the widget's properties.

The setProps() function returns a Promise that resolves when the properties are set. To use this function on an inner (nested) widget, use getNestedWidget().

Note: The setProps() function doesn't work in preview mode.

Method Declaration
Copy
function setProps(props: object): Promise<void>;
Method Parameters
propsPropsRequired

Object with some or all of the widget's properties.

Set a widget's properties
JavaScript
import wixWidget from "wix-widget"; // ... wixWidget.setProps({ saleIndicator: "No Sale" }).then(() => { // Code to execture after setting the props });
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?