R

Dialog

11 parts

Anatomy

Import the parts and compose them. Each part forwards attributes to its underlying element.

vue
import {
  DialogRoot,
  DialogTrigger,
  DialogPortal,
  DialogOverlay,
  DialogContent,
  DialogTitle,
  DialogDescription,
  DialogClose,
  DialogContentImpl,
  DialogContentModal,
  DialogContentNonModal,
} from '@robonen/primitives/dialog';

<DialogRoot>
  <DialogTrigger />
  <DialogPortal />
  <DialogOverlay />
  <DialogContent />
  <DialogTitle />
  <DialogDescription />
  <DialogClose />
  <DialogContentImpl />
  <DialogContentModal />
  <DialogContentNonModal />
</DialogRoot>

API Reference

DialogRoot

Root
PropTypeDescription
defaultOpen?booleanUncontrolled initial open state. Ignored once `v-model:open` is bound.
modal?booleanModal mode traps focus inside the content, locks body scroll, and marks the rest of the document as inert.

DialogTrigger

Trigger

No props or events — renders its element and forwards attributes.

DialogPortal

Portal
PropTypeDescription
forceMount?booleanWhen true the Portal (and its descendants) remain mounted even when the dialog is closed. Consumers use this to drive exit animations via CSS.

DialogOverlay

Overlay
PropTypeDescription
forceMount?booleanKeep overlay mounted even when the dialog is closed — useful for CSS exit animations.

DialogContent

Content
PropTypeDescription
forceMount?booleanKeep mounted for CSS exit animations.

DialogTitle

Title

No props or events — renders its element and forwards attributes.

DialogDescription

Description

No props or events — renders its element and forwards attributes.

DialogClose

Close

No props or events — renders its element and forwards attributes.

DialogContentImpl

ContentImpl
PropTypeDescription
trapFocus?booleanTrap focus inside the content (modal dialogs).
disableOutsidePointerEvents?booleanBlock outside pointer events (modal dialogs).
role?'dialog' | 'alertdialog'ARIA role on the content. Defaults to 'dialog'; use 'alertdialog' for AlertDialog.

DialogContentModal

ContentModal

No props or events — renders its element and forwards attributes.

DialogContentNonModal

ContentNonModal

No props or events — renders its element and forwards attributes.