HelpTribe.

Dialog

Modal overlay for focused interactions. Includes backdrop blur, header, title, and description sub-components.

Installation

$ npx shadcn@latest add dialog

Preview

Usage (React/TSX)

"use client"
import { useState } from "react"
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog"

export default function ConfirmDialog() {
  const [open, setOpen] = useState(false);
  return (
    <Dialog open={open} onOpenChange={setOpen}>
      <DialogContent>
        <DialogHeader>
          <DialogTitle>Delete Item</DialogTitle>
          <DialogDescription>
            This action cannot be undone.
          </DialogDescription>
        </DialogHeader>
      </DialogContent>
    </Dialog>
  )
}

Props

PropTypeDefaultDescription
openbooleanβ€”Whether the dialog is visible.
onOpenChange(open: boolean) => voidβ€”Called when the dialog open state changes.
childrenReactNodeβ€”Content inside the dialog (use DialogContent).