1.1.3 • Published 11 months ago

modal-react-loganb v1.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

modal-react-loganb

A simple modal component for React.

Installation

npm install modal-react-loganb

Prerequisites

Before using modal-react-loganb, ensure that your project meets the following requirements:

  • React version: 18.0.0 or higher
  • Node.js version: 20.0.0 or higher
  • npm version: 10.0.0 or higher

Usage

To use the modal-react-loganb component, follow these steps:

  1. Import the Modal component:
import { Modal } from "modal-react-loganb";
  1. Integrate the Modal into your React component:
import React, { useState } from "react";
import { Modal } from "modal-react-loganb";

function ExampleComponent() {
  const [isModalVisible, setIsModalVisible] = useState(false);

  const handleOpenModal = () => {
    setIsModalVisible(true);
  };

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

  return (
    <div>
      <button onClick={handleOpenModal}>Open Modal</button>
      <Modal isVisible={isModalVisible} onClose={handleCloseModal}/>
    </div>
  );
}

export default ExampleComponent;

Props

The Modal component accepts the following props:

  • isVisible: A boolean that determines whether the modal is visible (true) or hidden (false).
  • onClose: A function that will be called when the modal's close button is clicked, typically used to toggle the isVisible state.
1.1.1

11 months ago

1.1.0

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.1.3

11 months ago

1.1.2

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago