Murasaki
Components

Dialog

A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

Usage

import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@murasakijs/ui";
<Dialog>
  <DialogTrigger>Open</DialogTrigger>
  <DialogContent>
    <DialogHeader>
      <DialogTitle>Title</DialogTitle>
      <DialogDescription>Description</DialogDescription>
    </DialogHeader>
  </DialogContent>
</Dialog>

API Reference

Subcomponents

ComponentDescription
DialogThe root primitive. Accepts open, defaultOpen, onOpenChange, modal.
DialogTriggerThe element that opens the dialog. Supports asChild to render a custom trigger (e.g. Button).
DialogPortalPortals its children into document.body. Used internally by DialogContent.
DialogOverlayThe dimming backdrop. Rendered automatically by DialogContent.
DialogContentThe dialog panel. Renders a built-in close (X) button.
DialogHeaderVertical stack for DialogTitle / DialogDescription.
DialogFooterA row for actions, right-aligned on larger screens.
DialogTitleThe dialog's accessible name.
DialogDescriptionThe dialog's accessible description.
DialogCloseA button that closes the dialog. Supports asChild.

Modal focus containment, Escape handling, labeling, and focus restoration are provided by React Aria Components.

Improve this page on GitHub

On this page