Command Palette

Search for a command to run...

Dialog

shadcn/ui

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

import {	Dialog,	DialogContent,	DialogDescription,	DialogFooter,	DialogHeader,	DialogTitle,	DialogTrigger,} from "@/registry/optics/dialog";import { Button } from "@/registry/optics/button";<Dialog>	<DialogTrigger asChild>		<Button variant="raised">Edit Profile</Button>	</DialogTrigger>	<DialogContent>		<DialogHeader>			<DialogTitle>Edit profile</DialogTitle>			<DialogDescription>				Make changes to your profile here. Click save when you're done.			</DialogDescription>		</DialogHeader>		<div className="grid gap-4 py-4">			<div className="grid grid-cols-4 items-center gap-4">				<Label htmlFor="name" className="text-right">					Name				</Label>				<Input id="name" value="Pedro Duarte" className="col-span-3" />			</div>		</div>		<DialogFooter>			<Button type="submit" variant="raised">Save changes</Button>		</DialogFooter>	</DialogContent></Dialog>

Installation

pnpm dlx shadcn@latest add https://optics.agusmayol.com.ar/r/dialog.json

Props

<Dialog />
Name
Type
open
boolean
defaultOpen
boolean
onOpenChange
(open: boolean) => void
modal
boolean (default: true)

<DialogTrigger />
Name
Type
asChild
boolean
<DialogContent />
Name
Type
className
string
containerClassName
string
showCloseButton
boolean (default: true)
onEscapeKeyDown
(event: KeyboardEvent) => void
onPointerDownOutside
(event: PointerEvent) => void
onInteractOutside
(event: Event) => void
<DialogHeader />
Name
Type
className
string
<DialogFooter />
Name
Type
className
string
<DialogTitle />
Name
Type
className
string
<DialogDescription />
Name
Type
className
string
<DialogOverlay />
Name
Type
className
string
<DialogClose />
Name
Type
asChild
boolean