Lightweight easy to use, highly customizable react modal
To install, you can use npm or yarn:
$ npm install plain-react-modal
$ yarn add plain-react-modal
- React >= 16.x
- ReactDOM >= 16.x
import React, { Component } from 'react'
import Modal from 'plain-react-modal'
import 'plain-react-modal/dist/index.css'
class Example extends Component {
render() {
return (
<Modal
onClose={() => {
// code here
}}
title='Modal title'
overlayColor='rgba(255, 255, 255, .8)'
backgroundColor='#FFF'
>
<p>Woohoo, you're reading this text in a modal!</p>
</Modal>
)
}
}
Property | Type | Description |
---|---|---|
onClose (required) | func | Called when user clicks on close button |
title | String | Modal title |
overlayColor | String | Modal overlay color i.e. rgba(255, 255, 255, .8) |
backgroundColor | String | Modal dialog background color i.e. #FFF |
noShadow | boolean | Modal dialog shadow (default value is false) |
styles | object | Modal css style i.e. {maxWidth: '960px', color: '#2c3543'} |
Demo available at CodePen
Pull requests are welcome! You can create an issue or send in a PR. Please see here.
MIT © manjillama