0.1.9 • Published 8 months ago

success-custom-modal v0.1.9

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

My Modal Component

A reusable modal component for React.

Installation

npm install success-custom-modal

Usage

To use the ModalComponent in your React application, follow these steps:

Importing the ModalComponent

First, import the ModalComponent into your React component file:

import React, { useState } from "react";
import { ModalComponent } from "success-custom-modal";

Using the ModalComponent

Now, you can use the ModalComponent in your component's render method. Here's an example of how to use it:

const YourComponent = () => {
  const [showModal, setShowModal] = useState(false);

  const handleShowModal = () => {
    setShowModal(true);
  };

  const handleCloseModal = () => {
    setShowModal(false);
  };

  return (
    <div>
      <button onClick={handleShowModal}>Show Modal</button>
      <ModalComponent show={showModal} handleClose={handleCloseModal} />
    </div>
  );
};

export default YourComponent;

Customize this example to fit your application's needs. The show prop controls whether the modal is displayed, and the handleClose function should be used to close the modal.

License

This project is licensed under the MIT License.

This is for educational purpose so feel free to reuse it and adapt for your personal need
0.1.9

8 months ago

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