rj-modal-demo
v1.0.3
Published
Button that takes a modal as prop
Downloads
5
Readme
Installation
npm i --save react-modal-button
Usage
import React from 'react';
import { Modal } from 'react-plain-modal';
import { ModalButton } from 'react-modal-button';
const App = () => (
<div>
<h1>React Modal Button!</h1>
<ModalButton
modal={({ onRequestClose, ...rest }) => (
<Modal isOpen onClose={onRequestClose} {...rest}>
<p>My Modal</p>
<button onClick={onRequestClose}>Close</button>
</Modal>
)}
>
Button Text Here 🐕
</ModalButton>
</div>
);