Oddmash UI
All components

Dialog

Open a modal for editing or confirmation.

Usage

Use a dialog for a focused task that needs the current page as context. Keep the title specific and provide a clear way to leave.

Accessibility

Include DialogTitle and DialogDescription. Escape closes and restores trigger focus. Focus stays inside while open. Use container for a locally themed portal.

PropertyTypeDefault
open / defaultOpenbooleanfalse
onOpenChange(open: boolean) => voidNone
theme (DialogContent)light | darkinherited
container (DialogContent)HTMLElementdocument.body
<Dialog>
  <DialogTrigger asChild><Button>Edit project</Button></DialogTrigger>
  <DialogContent>
    <DialogTitle>Project settings</DialogTitle>
    <DialogDescription>Give your project a name.</DialogDescription>
    <label htmlFor="name">Name</label>
    <Input id="name" defaultValue="Interaction Inspector" />
    <DialogClose asChild><Button>Done</Button></DialogClose>
  </DialogContent>
</Dialog>

Interactive documentation