openModal

Opens a modal component.

Signature

Copy

Parameters

NameTypeDescription
componentIdstringID of the component to show in the modal, as defined in Wix Developer Center.
componentParamsRecord<string, any>Optional. Custom data to pass into the component, the component may consume this data using observeState

Returns

Copy

Note: Do not use relative CSS height units such as vh in the components passed to this function. The SDK adjusts component heights automatically. If your component uses relative height units by default, make sure to turn them off.

Examples

To set up a dashboard client, refer to the setup guide.

Open a modal

Copy

Pass extra data when opening a modal

Copy
  • This data can be consumed using the observeState function.
  • Note: Changes to the data passed into the modal won't trigger an update with observeState (unlike the regular behavior of this method, that allows to obeserve to data changes).

Get notified when the modal is closed

Copy
Did this help?