Meridianby Commenda
Components

Dialog

One focused task that blocks the page.

Blocks the page for one focused task: a short form, a choice, a confirmation. Dialog is a product element: on the website it appears in product shots and animations of the Commenda app, not as a marketing pop-up. If people need the page behind it, use a Sheet.

sm · 400
md · 480
lg · 600
xl · 800

Usage

Example.tsx
import { Dialog } from "@commenda/meridian/ui/dialog";

<Dialog
  trigger={<Button variant="secondary">Edit</Button>}
  title="Edit entity details"
  description="Changes apply to filings created from today."
  footerConfig={{ primaryAction: { label: "Save changes", onClick: save } }}
>
  <Input label="Legal name" />
</Dialog>;

Sizes

sm 400 for confirms, md 480 for one or two fields, lg 600 for forms (the default), xl 800 for tables and previews. The body scrolls on its own; the header and footer hairlines appear only once it does. The footer can carry one tertiary action on the left. Open each size below.

sm · 400
md · 480
lg · 600
xl · 800

Confirm

A preset for one yes-or-no decision: a question, one line on what happens, and a primary named for the action. No close button and no body. Destructive uses the destructive primary. The second example shows loading while it works.

default
destructive · loading

Anatomy

Header: title with an optional description and the close IconButton (sm). Body: 24 side padding, scrolls on its own. Footer: Cancel and the primary right-aligned, 8 apart, one tertiary action on the left. Radius 12, Elevation/modal, on a soft-pearl 1000 backdrop at 40%.

SizeWidth
sm400
md480
lg600
xl800

API reference

PropTypeDescription
titleRequiredstringFrom Pathfinder.
childrenRequiredReactNodeFrom Pathfinder.
openConditionalbooleanFrom Pathfinder.
onOpenChangeConditional(open: boolean) => voidFrom Pathfinder.
defaultOpenbooleanFrom Pathfinder.
triggerReactElement<unknown, string | JSXElementConstructor<any>>From Pathfinder.
descriptionReactNodeFrom Pathfinder.
footerConfigOverlayFooterConfigView fieldsFrom Pathfinder.
dismissConfigOverlayDismissConfigView fieldsFrom Pathfinder.
closeConfigObjectView fieldsHides only the header button; Escape/outside dismissal still follows dismissConfig.
focusConfigOverlayFocusConfigView fieldsFrom Pathfinder.
classNamestringFrom Pathfinder.
size"md" | "lg" | "xl" | "sm"From Pathfinder.
footerConfigObject fields
FieldTypeDescription
primaryActionOverlayAction
secondaryActionOverlayAction
leadingContentReactNode
cancelLabelstring
dismissConfigObject fields
FieldTypeDescription
outsidePressboolean
beforeClose(reason: OverlayCloseReason) => boolean | Promise<boolean>
onError(error: unknown) => void
closeConfigObject fields
FieldTypeDescription
visibleboolean
labelstring
focusConfigObject fields
FieldTypeDescription
initialFocusRefRefObject<HTMLElement | null>
returnFocusRefRefObject<HTMLElement | null>

Best practices

  • One task, one step. Multi-step flows are full pages, never a dialog. If people need the page behind it, use a Sheet.
  • The title says the task (Edit entity details) or asks the question (Delete this policy?). Sentence case.
  • Name the primary for what it does: Save changes, Delete policy. Never OK or Yes.
  • Cancel sits left of the primary, both right-aligned. At most one tertiary action goes on the left.
  • In an animation, the backdrop fades in and the dialog grows from 0.97 over 200 ms, ease-out. It closes in 150 ms.
  • Never use a Dialog as a marketing pop-up or to gate content. Lead capture lives on the page.
  • Source: Pathfinder Dialog. Meridian keeps it as is; the prototype is not carried over.

On this page