react-plain-modal
v2.0.2
Published
Extremely Lightweight React modal
Downloads
22
Readme
Installation
npm i --save react-plain-modal
Usage
import { Modal } from 'react-plain-modal';
class App extends Component {
state = {
isModalOpen: false,
};
openModal = () => {
this.setState({ isModalOpen: true });
};
closeModal = () => {
this.setState({ isModalOpen: false });
};
render() {
return (
<div>
<button onClick={this.openModal}>Open Modal</button>
<Modal isOpen={this.state.isModalOpen} onClose={this.closeModal}>
<div>Content</div>
<button onClick={this.closeModal}>Close Modal</button>
</Modal>
</div>
);
}
}