New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-bounded-draggable-modal

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-bounded-draggable-modal

A draggable modal component with boundary support for React and Next.js

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

react-bounded-draggable-modal

A draggable modal component with boundary support for React and Next.js.

Installation

npm install react-bounded-draggable-modal

or

yarn add react-bounded-draggable-modal

Usage

import React, { useState } from "react";
import Modal from "react-bounded-draggable-modal";

const App = () => {
  const [isOpen, setIsOpen] = useState(false);

  const handleOutsideClick = () => {
    setIsOpen(false);
  };

  return (
    <div>
      <button onClick={() => setIsOpen(true)}>Open Modal</button>
      <Modal
        isOpen={isOpen}
        onOutsideClick={handleOutsideClick}
        header={<div>Modal Header</div>}
        classNames={{
          modal: "custom-modal",
          header: "custom-header",
          body: "custom-body",
        }}
      >
        <div>Modal Content</div>
      </Modal>
    </div>
  );
};

export default App;

Props

ModalProps

NameTypeDescription
isOpenbooleanWhether the modal is open or not.
onOutsideClick() => voidFunction to handle clicks outside the modal.
headerReact.ReactNodeContent to be displayed in the modal header.
childrenReact.ReactNodeContent to be displayed in the modal body.
classNamesClassNamesOptional class names for modal, header, and body.

ClassNames

NameTypeDescription
modalstringClass name for the modal container.
headerstringClass name for the modal header.
bodystringClass name for the modal body.

License

MIT

Keywords

react

FAQs

Package last updated on 11 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts