About
A modal dialog overlay with a glassmorphic chamfered panel, zoom-in animation and a close button, used to focus the user on a task like confirming an action or editing a form without leaving the page.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Dialog to your project and fits it to your theme.
Code
How Dialog is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import * as React from "react";
import {
Dialog,
DialogClose,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
export default function DialogDemo() {
return (
<div className="flex min-h-[420px] w-full items-center justify-center bg-background p-8">
<Dialog>
<DialogTrigger className="inline-flex h-9 items-center justify-center whitespace-nowrap border border-primary/60 bg-primary px-4 text-sm font-medium text-primary-foreground transition-all hover:bg-primary/90 hover:shadow-[0_0_24px_color-mix(in_srgb,var(--color-primary)_50%,transparent)]">
Open dialog
</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-3">
<div className="grid gap-1.5">
<label
htmlFor="name"
className="text-sm font-medium text-foreground"
>
Name
</label>
<input
id="name"
defaultValue="Gil Hardi"
className="h-9 border border-input bg-foreground/5 px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring"
/>
</div>
<div className="grid gap-1.5">
<label
htmlFor="username"
className="text-sm font-medium text-foreground"
>
Username
</label>
<input
id="username"
defaultValue="@ghaerdi"
className="h-9 border border-input bg-foreground/5 px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring"
/>
</div>
</div>
<DialogFooter>
<DialogClose className="inline-flex h-9 items-center justify-center border border-primary/60 bg-primary px-4 text-sm font-medium text-primary-foreground transition-all hover:bg-primary/90">
Save changes
</DialogClose>
</DialogFooter>
</DialogContent>
</Dialog>
</div>
);
}
















