0.2.0 • Published 6 years ago

ds-react-popup v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

ds-react-popup

Popup container component for ReactJS. Working popup

Installation

To install, type in command prompt/terminal:

npm install --save ds-react-popup

Usage

...
import Popup from 'ds-react-popup'

...
    //In your component's render method
    render(){
        ...
        //Close prop takes a function, that will close the popup after the red X is clicked on.
        <Popup close={closePopup}>
            //Here place any children you want. Popup will adjust size to it's content.
        </Popup>
    }

If you wish to style popup, you can override two BEM classes:

ds-react-popup - default class for whole popup

ds-react-popup__close-button - class for close button

You can also provide your own class via className prop.

Props

close - Function, that will close popup after click on close button

CloseButton - React.Component that will replace the default red 'x' button

withoutCloseButton - Boolean flag, if false close button won't be rendered. Mind, that you have to provide other way to close popup.

Example

Clone the repository, install dependencies with npm i. Then, just run webpack-dev-server and go to http://localhost:8080/examples/basic/

Demos

Soon.

0.2.0

6 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago