ZaidanHomeDocsComponentsBlocksChartsTypesetCreate

Command Palette

Search for a command to run...

GitHub
New
Sections
  • Introduction
  • Components
  • Blocks
  • Installation
  • Customization
  • Dark Mode
  • Typeset
  • Zaidan Skills
  • FAQ
  • Roadmap
  • Changelog
Installation
  • Astro
  • Manual
  • Solid Start
  • TanStack Router
  • TanStack Start
  • Vite
Blocks
  • Data Grid
  • Event Calendar
  • Filters
  • Gantt
  • Image Crop
  • Kanban
  • Message Scroller
  • Questionnaire
  • Sortable
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Aspect Ratio
  • Attachment
  • Avatar
  • Badge
  • Breadcrumb
  • Bubble
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Collapsible
  • Combobox
  • Command
  • Context Menu
  • Dialog
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kbd
  • Label
  • Marker
  • Menubar
  • Message
  • Native Select
  • Navigation Menu
  • Pagination
  • Popover
  • Progress
  • Radio Group
  • Resizable
  • Scroll Area
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Spinner
  • Switch
  • Table
  • Tabs
  • Textarea
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip

Dialog

A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

Kobalte
Kobalte

The Dialog component is built on top of Kobalte Dialog, which provides accessible modal, focus-management, and keyboard behavior.

Installation

pnpm dlx shadcn@latest add @zaidan/dialog
npx shadcn@latest add @zaidan/dialog
yarn dlx shadcn@latest add @zaidan/dialog
bunx --bun shadcn@latest add @zaidan/dialog

Usage

1
import {
2
Dialog,
3
DialogContent,
4
DialogDescription,
5
DialogHeader,
6
DialogTitle,
7
DialogTrigger,
8
} from "~/components/ui/dialog";
9
import { Button } from "~/components/ui/button";
1
<Dialog>
2
<DialogTrigger as={Button} variant="outline">
3
Open
4
</DialogTrigger>
5
<DialogContent>
6
<DialogHeader>
7
<DialogTitle>Are you absolutely sure?</DialogTitle>
8
<DialogDescription>
9
This action cannot be undone. This will permanently delete your account
10
and remove your data from our servers.
11
</DialogDescription>
12
</DialogHeader>
13
</DialogContent>
14
</Dialog>

Composition

Use the following composition to build a Dialog:

Dialog
├── DialogTrigger
└── DialogContent
├── DialogHeader
│ ├── DialogTitle
│ └── DialogDescription
└── DialogFooter

Custom Close Button

Replace the default close control with your own button.

No Close Button

Use showCloseButton={false} to hide the close button.

Sticky Footer

Keep actions visible while the content scrolls.

Scrollable Content

Long content can scroll while the header stays in view.

API Reference

For all primitive props and keyboard interactions, see the Kobalte Dialog API reference.

On This Page

  • Installation
  • Usage
  • Composition
  • Custom Close Button
  • No Close Button
  • Sticky Footer
  • Scrollable Content
  • API Reference
Built by Kevin Abatan. The source code is available on GitHub.