shadcn.io is not affiliated with official shadcn/ui
Dialog examples · Standard
Standard Dialog for React
A share dialog with a read-only link, a Copy button and a Close button.
The everyday dialog: a title, a short description, some content and a way out. This React dialog shares a link with a read-only Input, a Copy button and Close. It's shadcn.io's Dialog on Base UI.
Preview
Installation
FAQ
How can people close it?
With Close, which is a DialogClose, the X in the corner, Escape, or a click outside.
How does focus work?
Focus moves into the dialog when it opens, stays inside while it's open, and returns to the trigger when it closes.
Can I stop a click outside from closing it?
Yes, for forms with unsaved changes. Pass disablePointerDismissal to Dialog. Keep Escape and the close button working.
How do I make Copy work?
Copy the link to the clipboard on click and confirm it. The Clipboard component does this with a built-in indicator.
Can a dialog open another dialog?
It can, but avoid it: a second modal on top is confusing. Change the dialog's content instead, or use a Sheet.
Related
- Scrollable DialogA privacy policy dialog whose long text
- Simple Confirmation Dialog Alert DialogA simple confirmation dialog with Cancel
- Bottom-Sliding SheetA sheet that slides up from the bottom of
- Scrollable with Sticky Header DialogA changelog dialog whose header stays in
- Simple Text PopoverA button that opens a popover with a
- Button with Text (Outline)A border, no fill