1.0.4 • Published 9 months ago

simple-react-modal-ocp14 v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

simple-react-modal

node v18.16.1

A simple, customizable React modal component that allows you to display content in a modal overlay.

Installation

To install the package, use npm:

npm install simple-react-modal-ocp14

How to use

First, import the module into your project:

import SimpleModal from "simple-react-modal-ocp14";

Example Usage

Here's an example of how to use the modal component in your project:

import { useState } from "react";
import SimpleModal from "simple-react-modal-ocp14";

export default function YourComponent() {
  const [modalIsOpen, setModalIsOpen] = useState(false);

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

  const openModal = () => {
    setModalIsOpen(true);
  };

  return (
    <div>
      <button onClick={openModal}>Open Modal</button>
      <SimpleModal
        text={"Your text here"}
        isOpen={modalIsOpen}
        closeModal={closeModal}
      />
    </div>
  );
}
PropTypeDescription
textstringThe text displayed in the modal.
isOpenbooleanControls if the modal is open or closed.
closeModalfunctionFunction to close the modal.

Styling

The modal includes basic inline styles. If you need additional styling, you can wrap the modal component or add custom CSS classes.

1.0.2

9 months ago

1.0.1

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.0

10 months ago