react-bb-poppop

    1.0.2 • Public • Published

    react-bb-poppop

    This is a modulable component to render poppop with some nice features !

    NPM JavaScript Style Guide

    Install

    npm install --save react-bb-poppop

    Usage

    import React, { Component } from 'react'
    import BbPopop from 'react-bb-poppop'
     
    export default class App extends Component {
      constructor(props) {
        super(props);
        this.state = {
          showPopop: false,
          showNotice: false
        };
     
      }
     
      togglePopop() {
        this.setState({
          showPopop: !this.state.showPopop
        });
      }
     
      noticePopop() {
        this.setState({
          showNotice: !this.state.showNotice
        });
      }
     
      render () {
        return (
          <div>
            <button onClick={this.togglePopop.bind(this)}>Message Box</button>
            {this.state.showPopop ? 
              <div>
                <BbPopop 
                  styles="message"
                  kind="Alert"
                  closePopop={this.togglePopop.bind(this)}
                >
                  Testing
                </BbPopop>
              </div>
              : null
            }
            <br/>
            <br/>
            <br/>
            <button onClick={this.noticePopop.bind(this)}>Notice Box</button>
            {this.state.showNotice ? 
              <div>
                <BbPopop 
                  styles="notice"
                  kind="Alert"
                  closePopop={this.noticePopop.bind(this)}
                >
                  Testing
                </BbPopop>
              </div>
              : null
            }
          </div>
        )
      }
    }

    License

    MIT © BananaBb

    Install

    npm i react-bb-poppop

    DownloadsWeekly Downloads

    4

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    19.5 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar