◇
Dialog
11 partsAnatomy
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| Prop | Type | Description |
|---|---|---|
defaultOpen? | boolean | Uncontrolled initial open state. Ignored once `v-model:open` is bound. |
modal? | boolean | Modal mode traps focus inside the content, locks body scroll, and marks the rest of the document as inert. |
DialogTrigger
TriggerNo props or events — renders its element and forwards attributes.
DialogPortal
Portal| Prop | Type | Description |
|---|---|---|
forceMount? | boolean | When 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| Prop | Type | Description |
|---|---|---|
forceMount? | boolean | Keep overlay mounted even when the dialog is closed — useful for CSS exit animations. |
DialogContent
Content| Prop | Type | Description |
|---|---|---|
forceMount? | boolean | Keep mounted for CSS exit animations. |
DialogTitle
TitleNo props or events — renders its element and forwards attributes.
DialogDescription
DescriptionNo props or events — renders its element and forwards attributes.
DialogClose
CloseNo props or events — renders its element and forwards attributes.
DialogContentImpl
ContentImpl| Prop | Type | Description |
|---|---|---|
trapFocus? | boolean | Trap focus inside the content (modal dialogs). |
disableOutsidePointerEvents? | boolean | Block outside pointer events (modal dialogs). |
role? | 'dialog' | 'alertdialog' | ARIA role on the content. Defaults to 'dialog'; use 'alertdialog' for AlertDialog. |
DialogContentModal
ContentModalNo props or events — renders its element and forwards attributes.
DialogContentNonModal
ContentNonModalNo props or events — renders its element and forwards attributes.