Dialog

PreviousNext

A modal overlay that focuses attention on a task or message.

Dialogs are modal overlays that interrupt the user to capture a decision or display focused content. Use them for confirmations, forms, and short tasks that require attention before continuing.

Basic Usage

For long content, constrain the body height and let it scroll while keeping the footer visible.

API Reference

Dialog

Root component. Manages open/closed state.

DialogTrigger

The element that opens the dialog. Use asChild to render as your own element.

DialogContent Props

PropTypeDefaultDescription
showCloseButtonbooleantrueWhether to render the X close button in the top-right corner

DialogHeader

Container for DialogTitle and DialogDescription. Provides consistent spacing.

DialogTitle

The dialog's accessible title. Always include this for screen reader support.

DialogDescription

Optional subtitle shown below the title.

DialogFooter Props

PropTypeDefaultDescription
showCloseButtonbooleanfalseRenders a "Close" button inside the footer automatically

DialogClose

Closes the dialog when activated. Use asChild to render as a Button.