npm.io
1.0.44 • Published 4 years ago

react-modal-plr

Licence
ISC
Version
1.0.44
Deps
0
Size
1.4 MB
Vulns
0
Weekly
0

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

Keywords