Skip to content

Dialog

A modal surface for a focused task or a decision, with a title, content and actions, or full screen on compact windows.

import { Dialog, DialogTrigger, DialogTitle, DialogHeader, DialogContent, DialogActions } from '@windmorph/react';

Playground

Code

import { Dialog, Button, DialogActions, DialogContent, DialogHeader, DialogTrigger } from '@windmorph/react'; <DialogTrigger>  <Button variant="tonal">Open dialog</Button>  <Dialog>    <DialogHeader>Delete draft?</DialogHeader>    <DialogContent>The draft and its attachments will be removed from this device.</DialogContent>    <DialogActions>      <Button variant="text">Cancel</Button>      <Button variant="text">Delete</Button>    </DialogActions>  </Dialog></DialogTrigger>

Examples

Basic dialog

Alert dialog

With an icon

Scrollable content

Placement

Custom position

Motion, onOpened and onClosed, and instant

Scale transition

Dividers and a choice

Full screen on compact windows

From a FAB (container transform)

Discarding unsaved changes