0.2.4 • Published 10 months ago

@djoudi21/react-modal-oc v0.2.4

Weekly downloads
-
License
-
Repository
github
Last release
10 months 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

10 months ago

0.2.3

11 months ago

0.2.2

11 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.9

11 months ago

0.1.8

11 months ago

0.1.7

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago