Dialog

A window that appears on top of the main window or another dialog, disabling interaction with the background content.

@radix-ui/react-dialog @lucide/react

Installation


1

Install the following dependencies:

npx shadcn@latest add https://sbthemes-storev2.vercel.app/r/dialog.json

Examples


Custom close button


API Reference

The Dialog component is based on @radix-ui/react-dialog and supports all of its props. And adds:

Root

Root component that controls all the parts of a dialog.

PropTypeDefault
modalbooleantrue
defaultOpenboolean-
openboolean-
onOpenChangefunction-

Trigger

A button that opens the dialog.

PropTypeDefault
asChildbooleanfalse
Data attributeValues
[data-state]"open" / "closed"