ghaerdi

Dialog

Forms

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&apos;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>
  );
}

Dependencies

More by ghaerdi

View all
  • Toast Notification

    Toast Notification

    3
  • Chart

    Chart

    1
  • Accordion

    Accordion

  • Calendar

    Calendar

  • Neon Glass Select

    Neon Glass Select

  • Skeleton

    Skeleton

  • Radio Group

    Radio Group

  • Neon Status Badge

    Neon Status Badge

More in Forms

View all
  • Premium Auth

    Premium Auth

    577
  • Login 1

    Login 1

    68
  • Contact Card

    Contact Card

    1.1K
  • Form

    Form

    18
  • Login Card

    Login Card

    36
  • Login 2

    Login 2

    15
  • Change Password Form

    Change Password Form

    11
  • Form

    Form

    3