0.9.1 • Published 8 months ago

whealthhealth-modal-react-component v0.9.1

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

React modal library of React components created using create-react-app.

Install

Install using npm install whealthhealth-modal-react-component

Props

NameTypeDescriptionRequired ?
ContentStringModal's content messageYes
displayModalBooleanDisplay modal or notYes
setDisplayModalBooleanChange value of displayModalYes

Example

Here's an example on how to use the modal

import { useState } from "react";
import ModalModule from '../lib/index';

function Modal() {

  const [displayModal, setDisplayModal] = useState(false);

  const handleOnclick = () => {
    setDisplayModal(true);
    console.log(displayModal);
  }
  
  return (
    <div className="main">
      <h1>Modal example</h1>
      {/* Setup a trigger */}
      <button onClick={handleOnclick}>Open Modal</button>
      {/* Here's an example on how to use the modal */}
      <div className="Modal">
        {/* You can customize the content of the modal */}
        { displayModal && <ModalModule content="Lorem, ipsum dolor." displayModal={displayModal} setDisplayModal={setDisplayModal}/> }
      </div>
    </div>
  );
}

export default Modal;
0.9.1

8 months ago

0.9.0

8 months ago

0.5.0

8 months ago

0.4.5

8 months ago

0.4.4

8 months ago

0.4.2

8 months ago

0.4.0

8 months ago

0.3.6

8 months ago

0.3.5

8 months ago

0.3.0

8 months ago

0.2.0

8 months ago

0.1.0

9 months ago