1.1.0 • Published 1 year ago

react_modal_for_hrnet v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Modal Component

A simple and customizable React component for creating modals.

Installation

You can install the package using npm:

npm install react_modal_for_hrnet

Usage Import the Modal component in your React application:

import Modal from "react_modal_for_hrnet";

Then, use it in your React component:

function App() {
    // Declare an React State
    const [modalOpen, setModalOpen] = useState(false);
    // Declare an callback function to change the state value
    const handleModalClose = () => {
        setModalOpen(false);
    };

    return (
        <>
            <Modal isOpen={modalOpen} closeModal={handleModalClose}>
                <h2>Hello World!</h2>
                <p>This is a sample modal.</p>
            </Modal>
        </>
    )
}

Props

The `Modal` component takes three props:

`isOpen` (required) A boolean value that determines whether the modal is open or closed.

`closeModal` (required) A function that will be called when the user clicks on the close button or outside of the modal.

`children` (optional) Any valid React component or HTML element to be displayed inside the modal.

Customization

You can customize the styles of the modal by adding your own CSS rules to the `.modal`, `.modal-content`, .`modal-header`, `.modal-body`, and `.modal-btn` classes in your application's CSS file.

License

This project is licensed under the MIT License. See the LICENSE file for details.

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1-a

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago