Extend

Dialog

Component

About

A modal dialog built on Base UI — accessible trigger, overlay, header, body panel and footer, with a smooth center-zoom open animation.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Dialog to your project and fits it to your theme.

Code

How Dialog is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { Button } from "@/components/ui/button";
import {
  Dialog,
  DialogClose,
  DialogContent,
  DialogFooter,
  DialogHeader,
  DialogPanel,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog";

export default function Default() {
  return (
    <div className="flex min-h-screen w-full items-center justify-center bg-background p-8">
      <Dialog>
        <DialogTrigger render={<Button variant="outline">Move to Trash</Button>} />
        <DialogContent className="w-[28rem] max-w-[calc(100vw-2rem)]">
          <DialogHeader>
            <DialogTitle>Move to Trash</DialogTitle>
          </DialogHeader>
          <DialogPanel>
            <p className="text-sm text-muted-foreground">
              “demo.docx” will be moved to the Trash. You can restore it later
              from there.
            </p>
          </DialogPanel>
          <DialogFooter>
            <DialogClose render={<Button variant="outline">Cancel</Button>} />
            <DialogClose render={<Button>Move to Trash</Button>} />
          </DialogFooter>
        </DialogContent>
      </Dialog>
    </div>
  );
}

Dependencies

More by Extend

View all
  • Bounding Box Citations

    Bounding Box Citations

    51
  • Layout Blocks

    Layout Blocks

    13
  • Color Picker

    Color Picker

    5
  • Autocomplete

    Autocomplete

  • Tooltip

    Tooltip

  • Popover

    Popover

  • Separator

    Separator

  • Input

    Input