The dashboard modal extension allows you to extend your Wix app's functionality by adding modals to your app's dashboard. You can control the modal using openModal()
and closeModal()
from the dashboard SDK.
Follow the instructions below to:
Run the following command and follow the prompts to create a dashboard modal extension:
Enter a name for your modal's folder. The CLI will create this directory with the chosen name containing your modal’s files.
Enter the name of your modal. This name will be used to refer to your modal in your app's dashboard.
Upon completion, the dashboard modal extension folder and files will be created in your local app files in the "dashboard" folder with the following structure:
For more on the files and their structure, see Dashboard Modal Extensions Files and Code.
Run the following command to open the dev menu:
Choose a dashboard page to display. This will open a browser window previewing your dashboard page.
Add code to your dashboard page that triggers your modal to open. Use openModal()
from the dashboard SDK. You can find your modal's ID in the modal.json
file.
Edit your modal.tsx
file to customize the modal itself. For example, change the text inside <Text>
to My Dashboard Modal
:
Set your dashboard modal extension to interact with custom data passed by the openModal()
function or any data passed from the dashboard page hosting a menu plugin that navigates to your modal.
To retrieve the data, use the observeState()
function.
Use React to add code and logic to your modal.
Save your files.
Go back to your dashboard page, open your modal, and see your changes.
Now that your app is ready for production, you can build your app and create a version on the Custom Apps page in your Wix Studio workspace.
Run the following command to build your app:
Run the following command and follow the prompts to create an app version:
An app version allows you to publish an app to the Wix App Market or install it on a site with a direct install URL.
For more information about building and deploying your app, see Build and Deploy an App with the CLI.