0.2.4 • Published 2 years ago

@djoudi21/react-modal-oc v0.2.4

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

React Modal npm Package

React Modal is a lightweight npm package that provides a modal component for displaying congratulatory messages in React applications.

Installation

To install React Modal, you can use npm or yarn:

npm install @djoudi21/react-modal-oc

or

yarn install @djoudi21/react-modal-oc

Usage

Import the Modal component in your React application:

import React from "react";
import Modal from "react-modal-component";

function App() {
    const [modalOpen, setModalOpen] = React.useState(false);

    const closeModal = () => {
        setModalOpen(false);
    };

    return (
        <div>
            <button onClick={() => setModalOpen(true)}>Open Modal</button>
            <Modal display={modalOpen} closeModal={closeModal} />
        </div>
    );
}

export default App;

The Modal component accepts two props:

  • 'display' (boolean): Flag indicating whether the modal should be displayed or hidden.
  • 'closeModal' (function): Callback function to close the modal.
0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago