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.9K
  • Book

    Book

    180
  • Calendar

    Calendar

    156
  • Theme Switcher

    Theme Switcher

    141
  • Snippet

    Snippet

    125
  • Table

    Table

    124
  • Toggle

    Toggle

    97
  • Feedback

    Feedback

    94

More in Buttons

View all
  • Texture Button

    Texture Button

    108
  • Button

    Button

    14
  • Notification Button

    Notification Button

    117
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Eclipse Button

    Eclipse Button

    44
  • Button Save

    Button Save

    50
  • App Store Button

    App Store Button

    484
  • Base Button

    Base Button

    1