> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: closeModal()

## Article: closeModal()

## Article Link: https://dev.wix.com/docs/sdk/host-modules/dashboard/close-modal.md

## Article Content:

# closeModal()

Closes the currently open modal.

> **Note:** This method can only be used in the code for a [dashboard modal extension](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/dashboard-extensions/dashboard-modals/about-dashboard-modals.md) and therefore can't be used when [extending sites](https://dev.wix.com/docs/develop-websites.md) or [building apps with Blocks](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-blocks/about-wix-blocks.md).

![Close Modal](https://wixmp-833713b177cebf373f611808.wixmp.com/images/8c75ac7037522b6a1a51a09e6903ec1a.gif)

## Method declaration
```typescript
(closeData?: Serializable) => void
```

## Parameters

| Name        | Type           | Description                                                                                                                                                                                                                                                                                                                                                                                  |
|-------------|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `closeData` | `Serializable` | Optional. Data to pass to the modal's opener. This data is returned by [openModal](https://dev.wix.com/docs/sdk/host-modules/dashboard/open-modal.md) once the modal is closed. It must be Serializable data, which means it can be cloned using the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). For example, you can't pass function callbacks in this parameter. |

## Returns

`void`

## Examples
> **Note:** To call this method in [self-managed apps](https://dev.wix.com/docs/api-reference/articles/platform-overview/about-self-managed-apps.md), you need to create a [client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). See the [setup](https://dev.wix.com/docs/sdk/host-modules/dashboard/introduction.md) guide for more details.

### Close a modal

```typescript
import { dashboard } from '@wix/dashboard';

dashboard.closeModal({ message: 'The modal is closed!' });
```