@desireeb/react-modal

1.2.5 • Public • Published

React Modal

A simple a reusable modal component for React

Modal thumbnail

Installation

The package can be installed via npm: npm install @desireeb/react-modal

Or via yarn: yarn add @desireeb/react-modal

You’ll need to install React, React DOM and PropTypes separately since those dependencies aren’t included in the package. Below is a simple example of how to use the Modal in a React view.

import React, { useState } from "react";
import { Modal } from "@desireeb/react-modal";


const Example = () => {

    const [showModal, setShowModal] = useState(false)

    return (
        <Modal show={showModal} handleCloseBtn={() => setShowModal(false)}>
            {content}
        </Modal>
    )
})

Compatibility

React 18.2.0 and newer

/@desireeb/react-modal/

    Package Sidebar

    Install

    npm i @desireeb/react-modal

    Weekly Downloads

    8

    Version

    1.2.5

    License

    MIT

    Unpacked Size

    39.5 kB

    Total Files

    13

    Last publish

    Collaborators

    • desireeb