Dialog

A modal dialog is a message box or child window that requires user interaction before returning to the parent window. These boxes appear on top of the open parent window that is currently displayed on the screen.

Props

NameDefaultDescription
isCloseVisible: booleantrueIf true, the close 'x' button will be visible.
onCloseClick: functionThis function will be called when the user clicks the close 'x' button. The responsibility of hiding the dialog lies with the user.
onBackgroundClick: functionThis function will be called when the user clicks background. The responsibility of hiding the dialog lies with the user.
overlay: booleantrueIf true, the dialog will be displayed over a darker background that covers the content behind.
tabIndex: number0Value of the tabindex given to the close 'x' button. Note that values greater than 0 are strongly discouraged.
children: nodeArea within the dialog that can be used to render custom content. We strongly encourage users to not change the tabindex of the inner components or elements. This can lead to unpredictable behaviour for keyboard users, affecting the order of focus and focus locking within the dialog.

Examples

Basic usage

With content

This is an example of how to use the Dialog to display multiple inputs and buttons to collect information.

With background click event

Example of a dialog that will close when the user clicks anywhere outside it.