# dialog\_close

Source: https://zotonic.com/docs/1615/dialog_close

URI: https://zotonic.com/id/1615

Language: en



Closes a dialog. When there is no dialog open then nothing happens.

Example, closing the top-most dialog:

```django
{% button text="cancel" action={dialog_close} %}
```

This button closes any open dialog when clicked.

There can be many levels of dialogs open, they are designated by a *level*, the default dialog opens at level 0. Higher levels are displayed above lower levels.

To close all open dialogs, pass level 0:

```django
{% button text="cancel" action={dialog_close level=0} %}
```

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1615?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1615?language=en>)
