Integrated ResearchPicasso
Components

Dialog

A modal for a focused task that interrupts the flow.

{/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */}

A modal for a focused task that interrupts the flow.

Import

import { Dialog, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter } from "@ir/ui";

Watch out

  • Dialog is NOT built on Overlay / Surface, unlike Popover and DropdownMenu. It shares the card treatment — bg/card, radius/xl, a 1px border/neutral/muted — but carries no shadow and no padding of its own; its three sections own their spacing instead. Written as its own card here rather than fighting the surface variant with overrides, and raised: if the intent is that a modal shares the floating card, the file should say so. The scrim IS shared — it is the same OverlayScrim.

Props

PropTypeRequiredWhat it does
closebooleanThe close button in the title row. Off only for a dialog that must be answered.

Do and don't

sm for confirmations, md for short forms, lg for multi-section work.

Don't — Pick a width by eye.

The file assigns each width a job. Anything bigger or longer belongs in a Drawer.

Keep modals for work that genuinely cannot continue around them.

Don't — Open a dialog for something the page could say inline.

A modal takes the whole screen hostage. Spend that only where the interruption is the point.

Say what will happen — Delete endpoint, Save changes.

Don't — Label the buttons OK and Cancel.

People read the button, not the paragraph. The verb is where the decision actually gets made.

Primary last, on the right, paired with a secondary or an outline.

Don't — Lead with the primary action, or pair it with a ghost button.

The eye finishes at the right-hand edge, so that is where the commitment belongs — and a ghost beside it reads as a third-tier action rather than the way out.

Leave the close on; drop it only when an answer is genuinely required.

Don't — Remove the close from a dialog people might open by accident.

Escape and the close are the same promise. Taking both away traps anyone who opened it by mistake.

Advance the content in place, or finish the first task.

Don't — Open a dialog from inside a dialog.

Two focus traps and two Escape handlers, and nobody can tell which layer they are answering.

Accessibility

  • Radix owns the focus trap, the Escape handler and the aria-modal wiring. A Dialog without a DialogTitle warns in development and leaves the dialog unnamed — give it one even when it is visually hidden.
  • The close button takes closeLabel as its aria-label; the X glyph is aria-hidden.
  • Its focus ring is offset against bg/card, not bg/app, because the button sits on the dialog surface.

Where it is drawn

Figma — structure from figma, measurements from figma.

Open in Storybook

On this page