# Dialog mode

<!-- AI-AGENT-NOTE: An interactive demo is embedded here but is not represented in this Markdown file. If you need to see it in action, open this page in a browser (e.g. via a browser-automation MCP like Chrome DevTools or Playwright), or let the user know a live demo is available on this page. -->

To open CKBox in dialog mode, set the [`dialog`](../../guides/configuration/configuration-options.md#dialog) configuration option to `true`. For more verbose configuration this option allows also for passing an object, which allows for more control over the opened dialog window. For details, please refer to the [`dialog`](../../guides/configuration/configuration-options.md#dialog) option description.

```js
CKBox.mount(document.querySelector('#ckbox'), {
	tokenUrl: 'https://your.token.url',
	dialog: true,
	assets: {
		// Callback executed after choosing assets
		onChoose: (assets) => {
			assets.forEach((asset) => {
				console.log(asset.data.url);
			})
		}
	}
});
```

Click on the button below to open CKBox in dialog mode.

<!-- AI-AGENT-NOTE: An interactive demo is embedded here but is not represented in this Markdown file. If you need to see it in action, open this page in a browser (e.g. via a browser-automation MCP like Chrome DevTools or Playwright), or let the user know a live demo is available on this page. -->

> **Note**
>
> Need more functionality? [Take a survey](https://surveys.hotjar.com/1d72aefc-0073-416d-9e70-b773458881b4) and help us develop CKBox to suit your needs better!

---

Full index of the CKBox documentation: [llms.txt](../../../llms.txt)
