1.0.44 • Published 2 years ago

react-modal-plr v1.0.44

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.40

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago