UIIcons

Dialog

A modal window that overlays the page to display focused content or capture user input.

Installation

pnpm dlx stera-ui@latest add dialog

Composition

Use the following composition to build a Dialog:

Dialog
├── DialogTrigger
└── DialogContent
    ├── DialogHeader
    │   ├── DialogTitle
    │   └── DialogDescription
    └── DialogFooter

Examples

Confirmation Dialog

Use DialogClose with a custom button to create cancel/confirm action pairs.

Scrollable Content

Set scroll="content" on DialogPopup and scroll on DialogContent to let the body scroll while the header and footer remain sticky.

API Reference

Built on Base UI's Dialog primitive — see the full API reference there.

DialogPopup

PropTypeDefault
scrollfalse | "content"false
showCloseButtonbooleantrue
initialFocusbooleantrue

DialogFooter

PropTypeDefault
showCloseButtonbooleanfalse

DialogTrigger

PropTypeDescription
renderReactElementRender prop for the trigger element

DialogClose

PropTypeDescription
renderReactElementRender prop for the close element