# Shadcn Dialog

> Open-source shadcn dialog components for modal forms, focused tasks, and confirmations.

- Type: shadcn/ui component, free
- Page: https://reui.io/components/dialog
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/dialog.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/dialog.md
- MCP: `get_component("dialog")`, then `get_examples("dialog")`
- Examples: 10

## When to use

- Short forms and settings that need an answer before the page continues
- Long text such as terms, read in a scrolling body that can grow to nearly full screen
- Reference overlays and notices, such as a keyboard shortcuts list or a session timeout

## When not to use

- A yes or no confirmation before a destructive action: use [Alert Dialog](https://reui.io/components/alert-dialog.md) (`get_component("alert-dialog")`)
- Long forms or record details that slide in from the screen edge: use [Sheet](https://reui.io/components/sheet.md) (`get_component("sheet")`)
- Mobile panels that open from the bottom and close with a swipe: use [Drawer](https://reui.io/components/drawer.md) (`get_component("drawer")`)

## Agent notes

- Compose the trigger through `render` on the base twin and `asChild` on the radix twin; the other one is silently ignored
- `DialogContent` renders its own close button; pass `showCloseButton` as false to drop it

## Examples

- [Basic](https://reui.io/components/dialog/c-dialog-1.md): Basic dialog. Best for a 2 field profile edit form with Cancel and Save changes in the footer.
- [Scrollable Content](https://reui.io/components/dialog/c-dialog-2.md): Dialog with scrollable content. Best for read only text in a body capped at 70vh that scrolls under the title, with no footer.
- [Sticky Footer](https://reui.io/components/dialog/c-dialog-3.md): Dialog with scrollable content and sticky footer. Best for a 70vh scrolling body above a footer whose Close button stays in view.
- [No Close Button](https://reui.io/components/dialog/c-dialog-4.md): Dialog without a close button. Best for a notice whose corner X is removed, leaving a footer Close button as the visible exit.
- [Custom Close Button](https://reui.io/components/dialog/c-dialog-5.md): Dialog with custom close button. Best for a profile form whose corner close button becomes a round bordered chip floating past the top right edge.
- [Full-Screen](https://reui.io/components/dialog/c-dialog-6.md): Full-screen fluid dialog with sticky header and footer. Best for a near full viewport modal with bordered header and footer bars around a scrolling body.
- [Destructive Confirmation](https://reui.io/components/dialog/c-dialog-7.md): Confirmation dialog with destructive action. Best for a delete prompt laid out as a dialog with a warning icon and a destructive button.
- [Cookie Consent](https://reui.io/components/dialog/c-dialog-8.md): Cookie consent dialog. Best for cookie category switches with a locked essential row and Save Preferences or Accept All actions.
- [Keyboard Shortcuts](https://reui.io/components/dialog/c-dialog-9.md): Dialog with keyboard shortcuts list. Best for a read only shortcut reference split into 2 columns of key chords in a wider modal.
- [Full Width Button](https://reui.io/components/dialog/c-dialog-10.md): Dialog with full width button. Best for a session timeout notice with one full width Sign In Again button and no Cancel.

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
