react-modal-jeromebrd
v0.1.4
Published
A simple React modal component with customizable text.
Downloads
103
Readme
React Modal By jeromebrd
A simple React modal component with customizable text.
Installation
npm install react-modal-jeromebrd
Usage
import Modal from 'react-modal-jeromebrd';
function App() {
const [isOpen, setIsOpen] = useState(false);
return (
<>
<button onClick={() => setIsOpen(true)}>Open Modal</button>
{isOpen && <Modal onClose={() => setIsOpen(false)}>Hello World!</Modal>}
</>
);
}
Props
- onClose (required): A function that will be called when the modal should be closed (e.g., when the user clicks the close button).
- children (optional): Content to display inside the modal. (type : string)