Ethereal Garden

Dialog

A window overlaid on the primary window that interrupts the user with important content.

When To Use

Use the Dialog component when you need to:

  • Display critical information that requires user attention
  • Collect user input through forms
  • Present detailed information without navigating away from the current page
  • Confirm user actions, especially destructive ones
  • Focus user attention on a specific task or content
  • Show additional options or settings

Dialogs help focus the user's attention on a specific task while maintaining context with the underlying page.

Examples

Basic

Form

Custom

Scrollable

Props

Dialog

PropTypeDefault
modal?
boolean
-
onOpenChange?
((open: boolean) => void)
-
defaultOpen?
boolean
-
open?
boolean
-

DialogTrigger

PropTypeDefault
asChild?
boolean
-
value?
string | number | readonly string[]
-
type?
"button" | "submit" | "reset"
-
name?
string
-
formTarget?
string
-
formNoValidate?
boolean
-
formMethod?
string
-
formEncType?
string
-
formAction?
string | ((formData: FormData) => void | Promise<void>)
-
disabled?
boolean
-
key?
Key | null
-
form?
string
-

DialogContent

PropTypeDefault
forceMount?
true
-
onCloseAutoFocus?
((event: Event) => void)
-
onOpenAutoFocus?
((event: Event) => void)
-
onInteractOutside?
((event: PointerDownOutsideEvent | FocusOutsideEvent) => void)
-
onFocusOutside?
((event: FocusOutsideEvent) => void)
-
onPointerDownOutside?
((event: PointerDownOutsideEvent) => void)
-
onEscapeKeyDown?
((event: KeyboardEvent) => void)
-
asChild?
boolean
-
key?
Key | null
-

DialogHeader

PropTypeDefault

DialogFooter

PropTypeDefault

DialogTitle

PropTypeDefault
asChild?
boolean
-
key?
Key | null
-

DialogDescription

PropTypeDefault
asChild?
boolean
-
key?
Key | null
-

DialogClose

PropTypeDefault
asChild?
boolean
-
value?
string | number | readonly string[]
-
type?
"button" | "submit" | "reset"
-
name?
string
-
formTarget?
string
-
formNoValidate?
boolean
-
formMethod?
string
-
formEncType?
string
-
formAction?
string | ((formData: FormData) => void | Promise<void>)
-
disabled?
boolean
-
key?
Key | null
-
form?
string
-