Dialog

Dialogs interrupt the user flow for focused tasks or confirmations.

Examples

Basic

Sizes

Scrollable body

Overview

Dialog is a modal window that interrupts the user flow for a focused task or confirmation. Built on Base UI Dialog. For destructive confirmations, prefer AlertDialog instead.

tsx
import {
  Dialog,
  DialogTrigger,
  DialogContent,
  DialogHeader,
  DialogTitle,
  DialogBody,
  DialogFooter,
  DialogClose,
} from "@rogo-technologies/ui/dialog";

<Dialog>
  <DialogTrigger>Open dialog</DialogTrigger>
  <DialogContent>
    <DialogHeader>
      <DialogTitle>Example</DialogTitle>
    </DialogHeader>
    <DialogBody>Anything goes in the body.</DialogBody>
    <DialogFooter>
      <DialogClose>Close</DialogClose>
    </DialogFooter>
  </DialogContent>
</Dialog>;

Usage

Sizes

Use the size prop on DialogContent to control the popup width. Available sizes: sm, md, lg, xl.

tsx
<DialogContent size="sm"></DialogContent>
<DialogContent size="lg"></DialogContent>

Scrollable body

Wrap overflowing content in DialogBody. Scroll behavior activates automatically with edge fades enabled by default.

tsx
<DialogContent>
  <DialogHeader>
    <DialogTitle>Long content</DialogTitle>
  </DialogHeader>
  <DialogBody>{/* very tall content */}</DialogBody>
  <DialogFooter>
    <DialogClose>Done</DialogClose>
  </DialogFooter>
</DialogContent>

Composition

For full control, compose the lower-level primitives directly:

tsx
import {
  Dialog,
  DialogTrigger,
  DialogPortal,
  DialogBackdrop,
  DialogPopup,
} from "@rogo-technologies/ui/dialog";

<Dialog>
  <DialogTrigger>Open</DialogTrigger>
  <DialogPortal>
    <DialogBackdrop />
    <DialogPopup></DialogPopup>
  </DialogPortal>
</Dialog>;

API

Dialog (Root)

PropTypeDefaultDescription
openbooleanControlled open state.
defaultOpenbooleanfalseInitial open state (uncontrolled).
onOpenChange(open: boolean) => voidCallback when open state changes.
modalbooleantrueWhether the dialog is modal.

DialogContent

PropTypeDefaultDescription
size"sm" | "md" | "lg" | "xl""md"Width of the dialog popup.
showCloseButtonbooleanfalseRenders an × close button in the top-right.
classNamestringAdditional CSS classes for the popup.

Subcomponents

ComponentPurpose
DialogTriggerButton that opens the dialog.
DialogCloseButton that closes the dialog.
DialogHeaderTop section wrapper. bordered prop adds a divider.
DialogTitleHeading element announced by screen readers.
DialogDescriptionOptional supporting copy below the title.
DialogBodyScrollable body region with edge fades.
DialogScrollAreaCustom scroll region wrapping ScrollArea.
DialogFooterBottom action row. bordered prop adds a divider.
DialogPortalPortals the popup to the document body.
DialogBackdropDimmed backdrop behind the popup.
DialogPopupThe popup container (low-level alternative to DialogContent).
DialogViewportViewport region for positioning.
DialogCloseButtonStandalone close button (used internally by showCloseButton).

All subcomponents accept standard HTML attributes for their underlying elements.

Guidelines

Do

  • Use a Dialog when a task needs the user's full attention (forms, multi-step flows, settings)
  • Provide a DialogTitle — it's required for screen readers
  • Give every dialog at least one explicit close action in the footer
  • Pick the smallest size that fits the content; oversized dialogs feel heavy

Don't

  • Don't use Dialog for destructive confirmations — use AlertDialog for those
  • Don't stack dialogs on top of each other; collapse them into a single flow
  • Don't put long forms in a sm dialog — switch to a route/page instead
  • Don't hide the title or skip a description when the action isn't obvious from context
Made in NYC© 2026 Rogo Technologies Inc.