eugenioenko

Dialog

Forms

About

A modal dialog window built on the native HTML dialog element, with trapped focus, an inert backdrop page, Esc-to-close behavior, and slots for a trigger button, title, description, body content and footer actions.

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 Dialog from "@/components/ui/dialog";

export default function DialogDemo() {
  return (
    <div className="flex min-h-[480px] w-full items-center justify-center bg-background p-10 text-foreground">
      <Dialog
        trigger={
          <button
            type="button"
            className="inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90"
          >
            Invite teammate
          </button>
        }
        title="Invite a teammate"
        description="They'll get an email with a link to join."
        footer={
          <button
            type="button"
            className="inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90"
          >
            Send invite
          </button>
        }
      >
        <label className="grid gap-1.5" style={{ fontSize: "var(--yarcl-fs)" }}>
          <span style={{ color: "var(--yarcl-neutral-text)" }}>Email</span>
          <input
            type="email"
            defaultValue="jordan@acme.dev"
            className="h-10 rounded-md border px-3 outline-none"
            style={{
              borderColor: "var(--yarcl-neutral-border)",
              background: "var(--yarcl-neutral-surface)",
              color: "var(--yarcl-neutral-text)",
            }}
          />
        </label>
      </Dialog>
    </div>
  );
}

More by eugenioenko

View all
  • Drawer

    Drawer

  • Link

    Link

  • Divider

    Divider

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 1

    Login 1

    52
  • Book A Demo 3

    Book A Demo 3

    83
  • Authentication Card

    Authentication Card

    47
  • Book A Demo 1

    Book A Demo 1

    69
  • Contact Card

    Contact Card

    1K
  • Login Card

    Login Card

    32
  • Login 2

    Login 2

    7