MDK Logo

Dialog

Modal dialogs, confirmation prompts, and dialog utilities

Modal and dialog components for user interactions.

Prerequisites

  • Install the packages
npm install \
  @tetherto/mdk-react-devkit \
  @tetherto/mdk-react-adapter \
  @tetherto/mdk-ui-foundation
  • Import styles: import '@tetherto/mdk-react-devkit/styles.css'

Components

@tetherto/mdk-react-devkit

Import the public APIs on this page from @tetherto/mdk-react-devkit.

AlertDialogAction

Primary confirmation button inside an <AlertDialog>; clicking dismisses the dialog and runs the action handler

agent-ready

Source

src/primitives/components/alert-dialog/USAGE.md

src/primitives/components/alert-dialog/index.tsx

AlertDialogCancel

Secondary dismiss button inside an <AlertDialog>; closes the dialog without invoking the destructive action

agent-ready

Source

src/primitives/components/alert-dialog/USAGE.md

src/primitives/components/alert-dialog/index.tsx

AlertDialogContent

Modal content surface for an <AlertDialog> — renders the centered panel above the overlay with focus trap

agent-ready

Source

src/primitives/components/alert-dialog/USAGE.md

src/primitives/components/alert-dialog/index.tsx

AlertDialogDescription

Supporting body text inside an <AlertDialog>; conveys the consequences of the action being confirmed

agent-ready

Source

src/primitives/components/alert-dialog/USAGE.md

src/primitives/components/alert-dialog/index.tsx

AlertDialogFooter

Right-aligned action row inside an <AlertDialog> — hosts the cancel and confirm buttons

agent-ready

Source

src/primitives/components/alert-dialog/USAGE.md

src/primitives/components/alert-dialog/index.tsx

AlertDialogHeader

Top section of an <AlertDialog> that groups the title and description above the action row

agent-ready

Source

src/primitives/components/alert-dialog/USAGE.md

src/primitives/components/alert-dialog/index.tsx

AlertDialogOverlay

Full-viewport scrim rendered behind an <AlertDialog> to block interaction with the page

agent-ready

Source

src/primitives/components/alert-dialog/USAGE.md

src/primitives/components/alert-dialog/index.tsx

AlertDialogTitle

Prominent title text inside an <AlertDialog> summarising the action that requires confirmation

agent-ready

Source

src/primitives/components/alert-dialog/USAGE.md

src/primitives/components/alert-dialog/index.tsx

DialogContent

Centered modal surface for a <Dialog> — renders above the overlay with focus trap and Escape-to-close

agent-ready

Source

src/primitives/components/dialog/USAGE.md

src/primitives/components/dialog/index.tsx

Props

PropStatusType / OptionsDefaultDescription
bareOptionalbooleanfalseApplies mdk-dialog__header--bare to the header
closableOptionalboolean-Shows an ✕ close button in the header
closeOnClickOutsideOptionalbooleantrueWhether clicking the overlay closes the dialog
closeOnEscapeOptionalbooleantrueWhether pressing Escape closes the dialog
descriptionOptionalstring-Renders DialogDescription below the title
onCloseOptionalVoidFunction-Fired when the ✕ button is clicked
titleOptionalstring-Renders DialogTitle (and optional DialogDescription) inside the header

DialogDescription

Supporting body copy inside a <Dialog> rendered below the title

agent-ready

Source

src/primitives/components/dialog/USAGE.md

src/primitives/components/dialog/index.tsx

DialogFooter

Action row at the bottom of a <Dialog> — typically primary/secondary buttons

agent-ready

Source

src/primitives/components/dialog/USAGE.md

src/primitives/components/dialog/index.tsx

DialogHeader

Top region of a <Dialog> that groups the title and description

agent-ready

Source

src/primitives/components/dialog/USAGE.md

src/primitives/components/dialog/index.tsx

Props

PropStatusType / OptionsDefaultDescription
bareOptionalbooleanfalseApplies mdk-dialog__header--bare to the header
closableOptionalboolean-Shows an ✕ close button in the header
onCloseOptionalVoidFunction-Fired when the ✕ button is clicked

DialogOverlay

Full-viewport scrim rendered behind an open <Dialog> to block background interaction

agent-ready

Source

src/primitives/components/dialog/USAGE.md

src/primitives/components/dialog/index.tsx

DialogTitle

Prominent title text at the top of a <Dialog> summarising the modal's purpose

agent-ready

Source

src/primitives/components/dialog/USAGE.md

src/primitives/components/dialog/index.tsx

On this page