openModal

Opens a dashboard modal extension on your app's dashboard page.

Open modal

Note: Before you use this function, you need a dashboard modal extension. Learn more about implementing dashboard modal extensions with the Wix CLI and in self-hosted apps.

Signature

Copy

Parameters

NameTypeDescription
modalInfoModalInfoInformation about the dashboard modal to open.

Note: openModal() used to accept 2 parameters: modalId and params. These parameters have been wrapped inside a modalInfo object. Using 2 parameters is deprecated but still supported.

ModalInfo Object

NameTypeDescription
modalIdstringID of the dashboard modal extension to open, as defined in the Wix Dev Center.
paramsRecord<string, any>Optional. Custom data to pass into the dashboard modal extension. The extension can access this data using observeState().

Returns

Copy

Note: Do not use relative CSS height units such as vh in the extensions opened by this function. Extension heights are adjusted automatically. If your extension uses relative height units by default, make sure to turn them off.

Examples

Note: To use this method in self-hosted apps, you need to create a client. See the setup guide for more details.

Open a modal

Copy

Pass extra data when opening a modal

Copy

You can access the data passed to openModal() in your extension code using observeState().

Get notified when the modal is closed

Copy
Did this help?