Gets the widget's current design preset.
The getDesignPreset()
function returns a Promise that resolves to the widget's current preset name. To use this function on an inner (nested) widget, use getNestedWidget()
.
Note:
The getDesignPreset()
function doesn't work in preview mode.
function getDesignPreset(): Promise<string>;
import wixWidget from "wix-widget";
// ...
wixWidget.getDesignPreset().then((designPreset) => {
// Code to execute with the designPreset string
});
// For example, designPreset can be "preset-1-wide"
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.