1.0.23 • Published 11 months ago

modal-react-epok974 v1.0.23

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

Modal React

Prerequisites

This package requires the following minimum versions to function properly:

  • Node.js : v16.18.1
  • React : v18.2.0
  • ReactDOM : v18.2.0
  • Styled Components : v6.0.0-rc.3

Make sure you have installed these versions before starting to use this package.

This Modal React package is a quick and efficient solution to add modal functionality to your React application. It is easy to use and customize, with multiple options available to tailor it to your needs.

Installation

To install this package, simply use the following command:

npm i modal-react-epok974

Usage

Using this package is simple. Just import the Modal component and integrate it into your application as follows:

import Modal from 'modal-react-epok974';

function App() {
  const [isOpen, setIsOpen] = React.useState(false);

  return (
    <>
      <button onClick={() => setIsOpen(true)}>Open Modal</button>

      <Modal
        open={isOpen}
        handleCloseModal={() => setIsOpen(false)}
        width="500"
        height="300"
      >
        Modal content
      </Modal>
    </>
  );
}

Props

Modal accepts the following props:

PropTypeDefaultDescription
widthstring'500px'The width of the modal.
heightstring'300px'The height of the modal.
openbooleanfalseA boolean indicating whether the modal should be open or closed.
handleCloseModalfunctionundefinedA function that is called when the user wants to close the modal.

Contributing

Contributions are always welcome. If you have a feature to suggest or a bug to report, feel free to open an issue.

You can check out the source code of this package at GitHub.

License

MIT

1.0.23

11 months ago

1.0.22

11 months ago

1.0.21

11 months ago

1.0.20

11 months ago

1.0.19

11 months ago

1.0.17

11 months ago

1.0.16

11 months ago

1.0.15

11 months ago

1.0.14

11 months ago

1.0.13

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago