1.0.6 • Published 4 years ago

plain-react-modal v1.0.6

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

plain-react-modal

Lightweight easy to use, highly customizable react modal

Build Status NPM JavaScript Style Guide License PRs Welcome

Installation

To install, you can use npm or yarn:

$ npm install plain-react-modal
$ yarn add plain-react-modal

Requirements

  • React >= 16.x
  • ReactDOM >= 16.x

Usage

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>
    )
  }
}

Options

PropertyTypeDescription
onClose (required)funcCalled when user clicks on close button
titleStringModal title
overlayColorStringModal overlay color i.e. rgba(255, 255, 255, .8)
backgroundColorStringModal dialog background color i.e. #FFF
noShadowbooleanModal dialog shadow (default value is false)
stylesobjectModal css style i.e. {maxWidth: '960px', color: '#2c3543'}

Demo

Demo available at CodePen

Contributing

Pull requests are welcome! You can create an issue or send in a PR. Please see here.

License

MIT © manjillama

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago