Dialog focuses user's attention on additional information and a specific action.
Use the info variant to convey complex information that doesn’t fit into a simple Confirmation Dialog such as lists, tables, and other longer messages.
The info variant has the x in the upper right, and is dismissible by clicking outside of the dialog (this is because we’re not worried about losing user’s inputs).
Use the form variant whenever the user needs to complete form fields within the body of the dialog.
The form variant does not have the x, and should not be dismissible by clicking outside of the dialog (we don’t want to lose the users’ progress).
While it is preferred to that ConfirmationDialog is used for simple dialogs, a header variant may be specified to change the tone of the Dialog component.
Pass one of the built-in values ("info", "warning", or "danger") to render the corresponding themed icon. If the built-in options don't satisfy your use case, you can pass a custom React element (such as an icon component) to headerIcon and it will be rendered directly in the icon slot.
When dialog content exceeds the available height, the body becomes scrollable. A gradient fade is applied at the edges to soften the transition, indicating that more content exists beyond the visible area.
| Name | Default | Description |
|---|---|---|
isOpen | false | booleanDetermines whether dialog is open. |
headerIcon | undefined | "info" | "warning" | "danger" | ReactElementIcon shown in the dialog header. Use `"info"`, `"warning"`, or `"danger"` for the built-in themed icons, or pass a custom React element to render it directly. |
variant | — | "info" | "form"Dialog variant. |
title | — | stringDialog title. |
children | — | ReactNodeDialog content. |
actions | — | ReactNodeActions to be displayed in the dialog footer. |
width | "md" | "xs"
| "sm"
| "md"
| "lg"
| "xl"
| "2xl"
| "3xl"
| "4xl"
| "5xl"
| "6xl"
| "auto"Dialog width. |
height | "auto" | ModalContentProps["height"]Dialog height. |
maxHeight | "60vh" | ModalContentProps["maxHeight"]Maximum height of the dialog content. It is recommended to keep the max height at 60vh. |
onClose | — | () => voidCallback for when dialog is closed. |
bodyRef | — | React.RefObject<HTMLDivElement>Ref for the ModalBody |