# Dialog Events

The KendoReact Dialog fires the [`onClose`](https://www.telerik.com/kendo-react-ui/components/dialogs/api/dialogprops#onclose) event when the user clicks the titlebar **Close** button or presses `Esc`. The event argument holds the original event and the Dialog instance.

To close the Dialog in this event handler, update the state that controls its rendering. The Dialog handles `Esc` only when you attach an `onClose` handler.

The buttons you place inside the [`DialogActionsBar`](https://www.telerik.com/kendo-react-ui/components/dialogs/api/dialogactionsbarprops) have their own `onClick` handlers and do not fire `onClose`. The following example handles `onClose` and the click of an action button.

[Demo Source](https://demos.telerik.com/kendo-react-ui/dialogs/dialog/events/func/source.txt)

## Suggested Links

* [API Reference of the Dialog](https://www.telerik.com/kendo-react-ui/components/dialogs/api/dialog)
