0.1.8 • Published 8 months ago

p14-oc-modal v0.1.8

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

Modal React Component

This is a simple modal React component that you can use in your projects.

Installation

You can install the component using npm:

npm i p14-oc-modal

Usage

To use the modal component, you need to import it into your React project:

import Modal from "p14-oc-modal";
const [isOpen, setIsOpen] = useState(false);
<Modal isOpen={isOpen} onClose={() => setIsOpen(false)}>
  <p>Modal text content</p>
</Modal>;

The isOpen prop controls whether the modal is visible or hidden, and the onClose prop is a function that will be called when the user clicks outside the modal or presses the escape key or clicks on the cross to close.

You can customize the style using the modal.scss folder.

Props

| isOpen | type : boolean | default value : false | description : Determines whether the modal is open or closed. |

| onClose | type : function | default value : undefined | description : Function to close the modal. |

| style | type : object | default value : {} | description : Content of the modal. |

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago