Basic

Hold open in state and set it back to false in onOk and onCancel, since the dialog never closes itself.

Width and centering

Set width to size the dialog and centered to place it in the middle of the viewport instead of near the top.

Top offset

Pass style a top value to move the dialog up or down from where it opens near the top of the viewport.

Full screen

Set width to "100vw", zero the top offset in style and give styles.body a height to fill the whole viewport.
Pass footer a node to replace the Cancel and OK buttons, like a seat count beside a single Send invites button.
Set footer to null to remove the button row, for a dialog people read and then close with the close button or Escape.

Button text

Set okText and cancelText to name the buttons after the action, like Publish and Not yet instead of OK and Cancel.
Pass footer a function to get the stock OkBtn and CancelBtn and add your own button beside them, like Save a copy.

Custom close icon

Pass closeIcon a node to replace the close glyph, like the close icon from your installed icon pack.

Without a close button

Set closable to false to hide the close button in the corner, while Escape, the mask and Cancel still close the dialog.

Mask

Set mask to false to remove it, { blur: true } to blur the page behind, or { closable: false } so a click on it does not close the dialog.

Scrollable body

Give styles.body a maxHeight and overflowY: "auto" so long content scrolls inside the body while the title and buttons stay in view.

Loading

Set loading to show a skeleton in place of the body and hide the footer while the dialog waits for its content.

Async close

Set confirmLoading while your request runs to show a spinner on OK, then close the dialog once the request finishes.

Destroy on hidden

Set destroyOnHidden to unmount the content when the dialog closes, so text typed into the field is gone the next time it opens.

Confirm and status dialogs

Call modal.confirm, info, success, error or warning from App.useApp() to open a themed dialog with a single function call.

Close all dialogs

Call Modal.destroyAll() to close every dialog opened with a function call at once, like a stack of three confirms.

useModal hook

Call Modal.useModal() to hold the dialog context yourself: render its contextHolder, then await a confirm to get the answer.

Update and destroy

Keep the handle a call like modal.success returns and use its update and destroy to change or close the open dialog, like a countdown.
Pass modalRender to wrap the whole dialog in an element, like a <form> so Enter in the field and the OK button both submit it.

classNames and styles

Pass classNames or styles to style one part of the dialog, like header and footer for a tinted band and title for the heading.

In context

The component inside real screens, with the components it usually sits beside.

Delete repository

A delete confirmation whose danger button stays disabled until you type the repository's name, the way GitHub guards a repository delete.

What's new

A release announcement with a photo carousel on top, a short list of new features with icons and a single Got it button.

API Reference