modal-lcp
v2.0.1
Published
Simple modal in React
Downloads
7
Maintainers
Readme
modal-lcp
Simple modal in React
Install
npm install --save modal-lcp
Usage
import React, { useState } from 'react'
import Modal from 'modal-lcp'
import 'modal-lcp/dist/index.css'
const Example = () => {
const [isModalOpen, setIsModalOpen] = useState(false);
const openModal = () => {
setIsModalOpen(true);
};
const closeModal = () => {
setIsModalOpen(false);
};
return (
<div>
<button onClick={openModal}>Cliquez ici</button>
<Modal isOpen={isModalOpen} onClose={() => closeModal()}>
<h2>TEST</h2>
</Modal>
</div>
)
}
License
MIT © laetitiaCP