getProps( )


Gets the widget's properties.

The getProps() function returns a Promise that resolves to an object with all of the widget's properties. To use this function on an inner (nested) widget, use getNestedWidget().

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

Method Declaration
Copy
function getProps(): Promise<object>;
Request
This method does not take any parameters
Returns
Return Type:Promise<object>
Get a widget's properties
JavaScript
import wixWidget from "wix-widget"; // ... wixWidget.getProps().then((props) => { // Code to execute with the props object }); // Props object can be, for example: {country: "us", upperLimit: 7}
Errors

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

Did this help?