--- title: Dialog description: A window overlaid on either the primary window or another dialog window, rendering the content underneath inert. featured: true component: true links: doc: https://www.radix-ui.com/docs/primitives/components/dialog api: https://www.radix-ui.com/docs/primitives/components/dialog#api-reference source: radix: true shadcn: true --- ## Usage ```tsx import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from '@/components/ui/dialog' ``` ```tsx Open Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. ``` ## Examples ### Custom close button ### Centered behaviour You can control whether the dialog is centered by passing `centered={false}` to the `DialogContent` component. ```tsx {3} Click here {/* * Content in here */} ``` ## Notes To activate the `Dialog` component from within a `Context Menu` or `Dropdown Menu`, you must encase the `Context Menu` or `Dropdown Menu` component in the `Dialog` component. For more information, refer to the linked issue [here](https://github.com/radix-ui/primitives/issues/1836). ```tsx {14-25} Dialog not centered Open Download Delete Are you absolutely sure? This action cannot be undone. Are you sure you want to permanently delete this file from our servers? ```