react-modal-popup
TypeScript icon, indicating that this package has built-in type declarations

0.2.7 • Public • Published

react-modal-popup

Installation:

npm install --save react-modal-popup

or

yarn add react-modal-popup

Usage :

Add ModalPopup to your component:

import React, { useState } from 'react';
import ModalPopup from 'react-modal-popup';

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

  const handleShowModal = () => setIsOpen(!isOpen);

  return (
    <div>
      <button onClick={ handleShowModal }>Open Modal</button>
      <ModalPopup
        isOpen={ isOpen }
        onCloseModal={ handleShowModal }
      >
        <h1>Modal</h1>
      </ModalPopup>
    </div>
  );
};

Package Sidebar

Install

npm i react-modal-popup

Weekly Downloads

1

Version

0.2.7

License

MIT

Unpacked Size

21.7 kB

Total Files

29

Last publish

Collaborators

  • januarsmad