haassiib

Draggable Resizable Modal

Forms

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

Dependencies

More by haassiib

View all
  • Tabs

    Tabs

    9
  • Month Range Picker

    Month Range Picker

    2
  • Bar Chart

    Bar Chart

    1
  • Condition Groups Builder

    Condition Groups Builder

    1
  • Sortable List

    Sortable List

  • Checkbox

    Checkbox

  • Tooltip

    Tooltip

  • Filter Panel

    Filter Panel

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 2

    Login 2

    7
  • Authentication Card

    Authentication Card

    47
  • Login 1

    Login 1

    52
  • Contact Card

    Contact Card

    1K
  • Login Form

    Login Form

    6
  • Form

    Form

    16
  • Book A Demo 3

    Book A Demo 3

    83