setDesignPreset( )


Sets the widget's design preset.

The setDesignPreset() function returns a Promise that resolves when the design preset is set. To use this function on an inner (nested) widget, use getNestedWidget().

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

Method Declaration
Copy
function setDesignPreset(preset: string): Promise<void>;
Method Parameters
presetstringRequired

Preset name.

Set a widget's design preset
JavaScript
import wixWidget from "wix-widget"; // ... wixWidget.setDesignPreset("Mobile");
Errors

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

Did this help?