0.6.2 • Published 8 months ago

hmstd-react-modal v0.6.2

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

To install and use the Modal component inside your React app, follow these steps:

Installation

  1. To install:
npm i hmstd-react-modal;

Usage

  1. Import the Modal component from the package, and include it in your component where you want to use it. :
import { Modal } from 'hmstd-react-modal';
  1. In your component, you can control the visibility of the modal using state (e.g., showModal) and open or close it by toggling the state with functions like openModal and closeModal.

Example

Here's an example:

import { Modal } from 'hmstd-react-modal'
import React from 'react'

function App() {

  const [showModal, setShowModal] = useState(true)

  const handleClick = () =>{
    setShowModal(false)
  }

  return (
    <div>
        {showModal ? (<Modal text="Test" handleClick={handleClick} buttonText="Close"/>):("")}
    </div>
    
  ) 
}

export default App;
0.6.2

8 months ago

0.6.1

8 months ago

0.6.0

8 months ago

0.4.1

8 months ago

0.4.0

8 months ago

0.3.2

8 months ago

0.3.1

8 months ago

0.3.0

8 months ago

0.2.0

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