npm.io
1.0.1 • Published 2 years ago

modal-vite-lib

Licence
MIT
Version
1.0.1
Deps
0
Size
5 kB
Vulns
0
Weekly
3

Modal-vite-lib

Requirements

React : 18.2.0
Node : 18.16.0

Install

npm i modal-vite-lib

Example

<div className="App">
  <Modal onClose={() => setIsDislplay(false)} isDisplay={isDisplay}>
    <p>Example modal content</p>
  </Modal>
</div>

In this example, we have three things to define :

  • isDisplay: it's a boolean to know if the modal is display or not
  • onClose: it's a function to close the modal, here with setIsDisplay
  • And then, the HTML content of the modal

Keywords