0.1.1 • Published 3 years ago
pg-react-modal v0.1.1
How to install
npm install pg-react-modalDescription
This library allows you to easily create a modal and customize it with parameters.
Usage
- Start by importing the library
import { Modal } from "pg-react-modal";- Import the hook
import useModal from 'pg-react-modal/dist/hooks/useModal'| Parameters | Type | Description |
|---|---|---|
| isOpen | Boolean | Defines if the modal is open or not |
| actionButton | Function | Bind a function to the button |
| headerContent | String | Add a title to the modal |
| bodyContent | String | Add a message to the modal |
| Hide | Function | Bind the Toggle function on the parameter to close the modal |
| buttonContent | String | Add a text to the button |
| mainBackground | String | Allows you to change the background color of the modal |
| modalBackground | String | Allows you to change the color of the modal box background |
| buttonBackground | String | Allows you to change the background color of the button |
| buttonColor | String | Allows you to change the text color of the button |