Skip to main content

Dialog

Dialog — Prism component.

Signature
Density
Viewport
Theme follows the navbar ☀/☾ toggle
Live demo
Open ↗

When to use

  • Use it when A focused, interruptive task or confirmation that must be resolved before continuing.
  • Reach for something else when Non-blocking messages (use Alert/toast) or large workflows (use a page).

Accessibility

Focus is trapped and returned to the trigger on close, Esc dismisses, and the backdrop is inert. Title wires aria-labelledby; variant="danger" still announces as a dialog.

Import

const { Dialog } = window.PrismDesignSystem_39d121;

Examples

Transactional

<Dialog isOpen={open} onClose={close} title="Invite a member"
primaryLabel="Send invite" onPrimary={send}>
<TextField label="Email" type="email" />
</Dialog>

Danger

<Dialog isOpen={open} onClose={close} variant="danger" size="sm"
title="Delete workspace" primaryLabel="Delete" onPrimary={destroy}>
This can’t be undone.
</Dialog>

Props

PropTypeRequiredDescription
isOpenbooleanYes
onClose() =&gt; void
titleReact.ReactNode
size"xs" | "sm" | "md" | "lg"
variant"passive" | "transactional" | "danger"Intent-based variant (Carbon approach): - "passive": informational, no actions, freely dismissable. - "transactional": requires a choice; background click won't dismiss. - "danger": transactional with a destructive primary action. Inferred from the action props when omitted.
primaryLabelstringPrimary action label — renders the standard footer.
onPrimary() =&gt; void
secondaryLabelstringSecondary/cancel label. Default "Cancel".
onSecondary() =&gt; void
isPrimaryDisabledboolean
dismissablebooleanOverride whether scrim-click/Esc dismiss. Defaults by variant.
footerReact.ReactNodeCustom footer node (overrides the generated action buttons).
childrenReact.ReactNode