0.1.38 • Published 9 months ago

my-react-app-hakim10 v0.1.38

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

my-react-app-hakim10

A lightweight React modal component for displaying content in a modal overlay, with support for fade-in and fade-out animations.

Installation

To install the package, run the following command:

npm install my-react-app-hakim10

Usage

The Modal component can be used to display any content in a modal dialog. You can control the visibility of the modal via the isOpen prop and close it with the onClose callback.

import React, { useState } from "react";
import Modal from "./Modal";
import "./App.css";

const App = () => {
  const [isModalOpen, setIsModalOpen] = useState(false);

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

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

  return (
    <div>
      <h2>
        <span>#</span>Example 1: Open &amp; Close with links
      </h2>

      <button onClick={handleOpenModal}>Open Modal</button>
      <Modal isOpen={isModalOpen} onClose={handleCloseModal}>
        <h1>My Modal Content</h1>
        <p>
          Thanks for clicking. That felt good. <br />
          Click on <span>Close</span>, click the overlay, or press ESC
        </p>
      </Modal>
    </div>
  );
};

export default App;

Styling

You can customize the modal's appearance using your own CSS or by modifying the default styles provided in Modal.css. The default classes you can override include:

.modal-overlay: The background overlay behind the modal.
.modal-content: The modal's content container.
.close-button: The close button inside the modal.
0.1.38

9 months ago

0.1.37

9 months ago

0.1.36

9 months ago

0.1.35

9 months ago

0.1.34

9 months ago

0.1.33

9 months ago

0.1.32

9 months ago

0.1.31

9 months ago

0.1.30

9 months ago

0.1.29

9 months ago

0.1.28

9 months ago

0.1.27

9 months ago

0.1.26

9 months ago

0.1.25

9 months ago

0.1.24

9 months ago

0.1.23

9 months ago

0.1.22

9 months ago

0.1.21

9 months ago

0.1.20

9 months ago

0.1.19

9 months ago

0.1.18

9 months ago

0.1.17

9 months ago

0.1.16

9 months ago

0.1.15

9 months ago

0.1.14

9 months ago

0.1.13

9 months ago

0.1.12

9 months ago

0.1.11

9 months ago

0.1.10

9 months ago

0.1.9

9 months ago

0.1.8

9 months ago

0.1.7

9 months ago

0.1.6

9 months ago

0.1.5

9 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

10 months ago