Components
Modal
A focused dialog over the page for short, blocking tasks.
Default
<Dialog>
<DialogTrigger render={<Button />}>Rename note</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Rename note</DialogTitle>
<DialogDescription>
The filename is used as the note title in mrkdwn.
</DialogDescription>
</DialogHeader>
<Input defaultValue="hello-world.md" />
<DialogFooter>
<DialogClose render={<Button variant="ghost" />}>Cancel</DialogClose>
<DialogClose render={<Button />}>Save</DialogClose>
</DialogFooter>
</DialogContent>
</Dialog> Variants
{/* Single button */}
<DialogFooter>
<DialogClose render={<Button />}>Got it</DialogClose>
</DialogFooter>
{/* Disabled actions */}
<Input value={filename} onChange={(e) => setFilename(e.target.value)} />
<DialogClose render={<Button disabled={filename === initialFilename} />}>
Save
</DialogClose>
{/* Focus input on open */}
<DialogContent initialFocus={focusRef}>
<Input ref={focusRef} placeholder="untitled.md" />
</DialogContent> Sticky header, scrollable body & footer
<DialogContent className="grid-rows-[auto_1fr_auto] p-0 max-h-[70vh]">
<DialogHeader className="border-b border-separator px-6 py-4">…</DialogHeader>
<div className="overflow-y-auto px-6 py-4">{/* long content */}</div>
<DialogFooter className="border-t border-separator px-6 py-4">
<DialogClose render={<Button />}>Done</DialogClose>
</DialogFooter>
</DialogContent>
The pinned header/footer with an internal scroll region is geist's Sticky and shadcn's
Sticky Footer + Scrollable Content. Other upstream variants map to props on the same
primitive: showCloseButton={false} for No Close Button,
a hand-placed <DialogClose> for a Custom Close Button,
and initialFocus for Control initial focus (see “Focus input
on open” above). Inset sections are just a bordered
-mx-6 block inside the body; the Base UI dialog already
traps focus (Toasts and focus trap) and, combined with a responsive
max-w, presents as a bottom sheet with working inputs on
mobile (Mobile sheet inputs).
Markdown for agents: /design/modal.md · spec: /design.md