Theme
Install with your agentnpx shadcn@4.23.1 add @goop/meadow-dialog

Dialog

Free

A window over the page for one focused task, such as a short form or a question to confirm, for React and Tailwind CSS. Free, MIT.

Press "Archive list": the dialog asks first. Archive list is busy for a moment and the list shows archived, with Bring back beside it. Cancel, Escape, the cross or a click outside leave it as it was; the focus comes back to the button (after an archive, to Bring back). The archive is a timer; the list lives in the page only.

When to use

  • A window over the page for one focused task, such as a short form or a question to confirm.
  • Also called: modal or popup.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Dialog on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

Terminal
npx shadcn@4.23.1 add @goop/meadow-dialog
PROMPT
Add the Goop Dialog to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { DialogPortal, DialogOverlay, DialogHeaderActions, DialogTitleBox, DialogDescriptionBox, DialogToolbar, DialogFooterGroup } from '@/components/ui/goop/dialog';

import { Button } from '@/components/ui/goop/button';
import {
  Dialog,
  DialogBody,
  DialogClose,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogFooterEnd,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from '@/components/ui/goop/dialog';

function ArchiveList({ onArchive }: { onArchive: () => void }) {
  return (
    <Dialog>
      <DialogTrigger asChild>
        <Button variant="outline">Archive list</Button>
      </DialogTrigger>
      <DialogContent size="xs">
        <DialogHeader>
          <DialogTitle>Archive this list?</DialogTitle>
        </DialogHeader>
        <DialogBody>
          <DialogDescription>Its 12 notes move to the archive, where the crew can restore them.</DialogDescription>
        </DialogBody>
        <DialogFooter>
          <DialogFooterEnd>
            <DialogClose asChild>
              <Button variant="ghost">Cancel</Button>
            </DialogClose>
            <DialogClose asChild>
              <Button onClick={onArchive}>Archive list</Button>
            </DialogClose>
          </DialogFooterEnd>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  );
}
  • Fits: list, settings: overlay.
  • height, width, padding, gap, corner, border, background, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
open?boolean
defaultOpen?boolean = false
onOpenChange?(open: boolean) => void
modal?boolean = true
  • State: open (open / defaultOpen / onOpenChange); drawn by data-state=open
Parts
PartWhat it is
DialogTriggerWraps the control that opens the dialog; also takes asChild?: boolean
DialogPortalWhere the layer is drawn
DialogCloseWraps a control that closes the dialog, such as a Cancel button in the footer; also takes asChild?: boolean
DialogOverlayThe dimmed page behind a modal dialog; DialogContent draws it, so add none yourself
DialogContentThe scrim, the positioner and the panel, in a portal — the end of <body>, or container; its props: dialog--content.md
DialogHeaderThe dialog's top; put the DialogTitle in it, with any chips or actions before the close, and a field after the title; its props: dialog--header.md
DialogHeaderActionsThe header's actions, 12 px after its content and 4 px apart; its props: dialog--header-actions.md
DialogTitleThe dialog's name, which every dialog needs; put it in the DialogHeader
DialogDescriptionA line that says what the dialog is for, read out with its title; put it in DialogBody
DialogBodyThe dialog's main content (a description, fields, sections of rows), between its header and footer
DialogDescriptionBoxThe boxes a many-line field sits in under it (the caller's field, the theme's Textarea, which grows with its words from one row), for a form a caller builds
DialogFooterThe dialog's bottom row for its buttons; put them in DialogFooterEnd, the main action last, and what stands apart (a link to copy, a quiet button) in DialogFooterGroup at its start
DialogFooterGroupThe footer's group at its start (a quiet button, a switch)
DialogFooterEndThe footer's end, growing, its controls at the end 8 px apart (the main action the last)
  • Required: DialogTitle, inside DialogContent
  • DialogTitleBox
  • DialogToolbar

DialogContent

The scrim, the positioner and the panel, in a portal — the end of <body>, or container.

TSX
import { DialogContent } from '@/components/ui/goop/dialog';

Options

  • variant: default (default), window
  • size: xs, sm (default), md, lg, full
  • container?: HTMLElement | null — Where the layer is portalled; the end of <body> when left out.

DialogHeaderActions

The header's actions, 12 px after its content and 4 px apart.

TSX
import { DialogHeaderActions } from '@/components/ui/goop/dialog';

Options

  • closable?: boolean = true — Draw the default close button last (true); false when the caller's children hold their own, or none is wanted.
  • closeLabel?: string = 'Close' — The default close button's accessible name.

Keyboard

KeyWhat it does
EnterOn the trigger: open, the focus on the panel's first control
SpaceOn the trigger: open, the focus on the panel's first control
Tab Shift+TabCycle the focus through the panel's controls, never out of it (the window: walk out in the page's order)

Accessibility

  • The behaviour layer under the part answers keys, focus and dismissal: never write your own.

Motion

  • The part sets its own motion: add no transition or animation of your own.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/meadow/components/dialog.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/meadow-dialog

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.