Dialog
Dialog focuses attention on a decision, short form, or other modal task.
Purpose
Dialog focuses attention on a decision, short form, or other modal task. Use Alert Dialog for destructive confirmation.
Invite member dialog
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/dialogImport
import { Dialog, DialogClose, DialogCreateHandle, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPopup, DialogTitle, DialogTrigger } from "@/components/ui/dialog";Need the machine-readable source metadata? View registry JSON.
Usage
Use Dialog for short modal workflows. Keep the title, description, panel and footer slots explicit.
import { Dialog, DialogClose, DialogPopup, DialogTrigger } from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
export function Example() {
return (
<Dialog>
<DialogTrigger render={<Button />}>Open dialog</DialogTrigger>
<DialogPopup>
<DialogClose render={<Button variant="outline" />}>Cancel</DialogClose>
</DialogPopup>
</Dialog>
);
}Examples
Form submission, footer variants, close button control, mobile behavior and panel scrolling are props and compositions of the same primitive.
Modal form
Without close button
Mobile bottom stick
Scrollable panel
Nested dialogs
A dialog opened from an open dialog scales and fades the parent through the built-in nested styling.
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
- Compose Trigger, Popup, Title, Description, optional Panel and Footer, and explicit actions.
DialogCreateHandlesupports one dialog with detached triggers or imperative opening.DialogPopup closePropscustomizes the built-in close Button while preserving it. UseshowCloseButton={false}only when another clear close action exists.DialogContentis a compatibility alias forDialogPopup; useDialogPopupin new code.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Backdrop uses the overlay duration and opacity transition.
- Popup uses native dialog motion and the modal duration.
- Do not add a second Dialog animation around the popup.
- Global reduced-motion behavior removes unnecessary transforms.
Accessibility
- Every Dialog requires a concise
DialogTitleand should include aDialogDescriptionwhen the task needs explanation. - Preserve modal focus trapping, initial focus, Escape, outside-click behavior, and focus restoration.
- All close and submit controls must be real Button components with accessible names.
- If the built-in close Button is hidden, provide an equally discoverable close action.
Implementation Guidance
- Use Dialog for focused modal tasks and Alert Dialog for destructive confirmation.
- Use canonical
DialogPopupin new code. - Preserve native focus, dismissal, close Button, and motion behavior.