About
A centered dialog over a dimmed backdrop that can be dragged by its title bar and resized from any edge or corner, with escape/backdrop dismissal and size presets.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Draggable Resizable Modal to your project and fits it to your theme.
Code
How Draggable Resizable Modal is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import Modal from "@/components/ui/modal";
import { useState } from "react";
export default function ModalDemo() {
const [open, setOpen] = useState(false);
return (
<div className="flex min-h-screen w-full items-center justify-center bg-background p-10">
<button
type="button"
onClick={() => setOpen(true)}
className="btn-primary"
>
Open modal
</button>
<Modal
isOpen={open}
onClose={() => setOpen(false)}
title="Invite a member"
size="md"
>
<div className="space-y-4">
<div>
<label className="field-label" htmlFor="invite-email">
Email
</label>
<input
id="invite-email"
type="email"
placeholder="name@example.com"
className="field-input"
/>
</div>
<div className="flex justify-end gap-2 pt-2">
<button
type="button"
onClick={() => setOpen(false)}
className="btn-ghost"
>
Cancel
</button>
<button
type="button"
onClick={() => setOpen(false)}
className="btn-primary"
>
Send invite
</button>
</div>
</div>
</Modal>
</div>
);
}
















