---
title: "Dialog"
description: "A modal window for forms and focused tasks, with focus trapping, scroll locking, and an accessible title. Built on Base UI."
plan: Free
docs: https://ui.edbn.me/docs/components/dialog
---

# Dialog

A modal window for forms and focused tasks, with focus trapping, scroll locking, and an accessible title. Built on Base UI.

## Installation

```bash
npx shadcn@4.19.0 add https://ui.edbn.me/r/dialog.json
```

## Dependencies
- npm: @base-ui/react@^1.8.0, lucide-react@^1.33.0
- edbn: edbn-base, button

## Usage

```tsx examples/dialog-basic.tsx
"use client";
import { Button } from "@/components/ui/button";
import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";

export default function DialogBasicPreview() {
  return (
    <Dialog>
      <DialogTrigger render={<Button />}>Edit profile</DialogTrigger>
      <DialogContent>
        <DialogHeader>
          <DialogTitle>Edit profile</DialogTitle>
          <DialogDescription>
            Update your public display name.
          </DialogDescription>
        </DialogHeader>
        <Input aria-label="Display name" defaultValue="Ada Lovelace" />
        <DialogFooter>
          <Button>Save changes</Button>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  );
}
```

## Files
- components/ui/dialog.tsx (172 lines)

## For agents
- Base theme, once per project: npx shadcn@4.19.0 add https://ui.edbn.me/r/edbn-base.json
- MCP server with search, items, examples and source: https://ui.edbn.me/mcp
- Every page and item: https://ui.edbn.me/llms.txt
