tigran tumasov

Modal

Buttons 12

About

Display popup content that requires attention or provides additional information.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Modal to your project and fits it to your theme.

Code

How Modal is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { useState } from "react";
import { Button } from "@/components/ui/button-1";
import { Modal } from "@/components/ui/modal";

export default function InsetDemo() {
  const [open5, setOpen5] = useState(false);
  return (
        <div>
          <Button onClick={() => setOpen5(true)} size="small">
            Open Modal
          </Button>

          <Modal.Modal active={open5} onClickOutside={() => setOpen5(false)}>
            <Modal.Body>
              <Modal.Header>
                <Modal.Title>Modal</Modal.Title>
                <Modal.Subtitle>This is a modal.</Modal.Subtitle>
              </Modal.Header>

              <Modal.Inset>
                <div className="font-sans text-sm text-[#171717] dark:text-[#ededed]">Content within the inset.</div>
              </Modal.Inset>

              <div className="pt-6">
                <div className="font-sans text-sm text-[#171717] dark:text-[#ededed]">Content outside the inset.</div>
              </div>
            </Modal.Body>

            <Modal.Actions>
              <Modal.Action onClick={() => setOpen5(false)} type="secondary">
                Cancel
              </Modal.Action>

              <Modal.Action onClick={() => setOpen5(false)}>Submit</Modal.Action>
            </Modal.Actions>
          </Modal.Modal>
        </div>
  );
}

Dependencies

More by tigran tumasov

View all
  • Product Hunt Badge

    Product Hunt Badge

    1.8K
  • Book

    Book

    162
  • Calendar

    Calendar

    152
  • Theme Switcher

    Theme Switcher

    135
  • Snippet

    Snippet

    124
  • Table

    Table

    123
  • Toggle

    Toggle

    89
  • Feedback

    Feedback

    88

More in Buttons

View all
  • Button

    Button

    14
  • Button

    Button

    34
  • Texture Button

    Texture Button

    92
  • Button Save

    Button Save

    46
  • Button

    Button

    64
  • Button Group

    Button Group

    3
  • App Store Button

    App Store Button

    454
  • Notification Button

    Notification Button

    103