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

1.0.44 • Public • Published

React Modal

A simple and reusable Modal component for React, using Typescript.

Installation

This package can be installed via NPM : npm i react-modal-plr

Or Yarn : yarn add react-modal-plr

You’ll need to install React and eventually PropTypes (if you want to use this library in a JS project) separately since those dependencies aren’t included in the package.

Usage

Here is an example of how you can use this modal component :

import { Modal } from 'react-modal-plr';

const Example = () => {
   const [showModal, setShowModal] = useState(false);
   return (
      <Modal
         setShowModal={setShowModal}
         children={
            <>
               <h2>Oh yeah !</h2>
               <p>What you wanted to do was a success</p>
            </>
         }
         buttonContent={'Close'}
      />
   );
};

Need more customization ? You can always override the default styles by assigning new CSS properties to the elements.

License

MIT © PriscilleLR

Package Sidebar

Install

npm i react-modal-plr

Weekly Downloads

1

Version

1.0.44

License

ISC

Unpacked Size

1.47 MB

Total Files

17

Last publish

Collaborators

  • priscille-lr