Dialog preview

Dialog

A centred modal on the native <dialog> element: title, description, body and a button row, with an alert variant for confirmations.

  • Group
    Dialogs and sheets
  • Origin
    Inspired · Original (this library)
  • License
    MIT
  • Added
    Oct 22
npx shadcn@latest add @deank/dialog

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

import { Dialog } from "@/registry/components/dialog/dialog";

<Dialog open onOpenChange={() => {}} title="…">Label</Dialog>

Props

PropTypeDefaultDescription
openboolean
onOpenChange(open: boolean) => void
titlestring
description?string
children?ReactNode
footer?ReactNodeButtons row at the bottom, e.g. Cancel and Confirm
dismissible?booleantrueClose when the backdrop is clicked
variant?"default" | "alert""default""alert" for confirmations that must be answered: no backdrop dismiss, role alertdialog
width?number440
inline?booleanfalseRender in place without the modal layer (docs and previews)

When to use

A focused task or confirmation that must be finished or cancelled before going back to the page: delete confirmations, short forms, previews.

When not to use

Long forms or detail views (use sheet); non-blocking feedback (use toast); anything the user may want to compare with the page behind.

Related

Sheet / drawer · Command palette · Button