Dialog

A window overlaid on the page.

Installation

  1. Add the registryOnce per project
  2. Add dialog

Usage

Pass a Button to render on the trigger and close buttons. Always include a DialogTitle.

To open or close the dialog from your own code, control it with open and onOpenChange.

Composition

Examples

Wide

Set a wider max-w on DialogContent for content that needs more room.

showCloseButton={false} on DialogContent hides the close button in the corner, and showCloseButton on DialogFooter adds one to the footer instead.

Props

createDialogHandle makes a handle to pass as handle to a Dialog. Its open(null) and close() open and close the dialog from code, such as a keyboard shortcut, and isOpen says whether it's open. A DialogTrigger outside the Dialog takes the same handle.

The tables leave out className, style and render. Parts built on Base UI take them as its styling and composition guides describe.

Dialog

DialogTrigger

DialogPortal

DialogClose

DialogOverlay

DialogContent

DialogFooter