> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: openModal(modalId: string, modalParams: object) # Method package: wixDashboard # Method menu location: wixDashboard --> openModal # Method Link: https://dev.wix.com/docs/velo/apis/wix-dashboard/open-modal.md # Method Description: Opens a [dashboard modal extension](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/dashboard-extensions/dashboard-modals/about-dashboard-modals.md). > **Note:** This function can only be used in page code files for dashboard pages created in the [Wix editor](https://support.wix.com/en/article/velo-working-with-dashboard-pages) or with [Wix Blocks](https://support.wix.com/en/article/wix-blocks-creating-and-managing-blocks-dashboard-pages). The `openModal()` function returns an object with a property called `modalClosed`. This property is a promise that resolves to the data passed to [`closeModal()`](#closeModal) when the modal is closed. > **Note:** Before you use this function, you need a dashboard modal extension. Learn more about [implementing dashboard modal extensions](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/dashboard-extensions/dashboard-modals/add-dashboard-modal-extensions-with-the-cli.md). # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Open a modal and log the data returned when it's closed ```javascript import { openModal } from 'wix-dashboard'; /* Sample modalID: '1d52d058-0392-44fa-bd64-ed09275a6fcc' */ const { modalClosed } = openModal('myModalId') modalClosed .then((closeData) => { console.log('The modal was closed and returned: ', closeData); }) .catch((error) => { console.error(error); // Handle the error }); /* The value of `modalClosed` resolves to an object containing the data passed in when the modal is closed. */ ``` ## Pass data to a modal extension ```javascript import { openModal } from 'wix-dashboard'; /* Sample modalID value: '1d52d058-0392-44fa-bd64-ed09275a6fcc' * Sample modalParams value * { * firstName: 'Name' * } */ const { modalClosed } = client.dashboard.openModal('myModalId', myModalParams) modalClosed .then((closeData) => { console.log('The modal was closed and returned: ', closeData); }) .catch((error) => { console.error(error); // Handle the error }); /* The value of `modalClosed` resolves to an object containing the data passed in when the modal is closed. */ ``` ---