1.0.0 • Published 5 years ago

react-easy-snackbar v1.0.0

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

Snackbar Build For ReactJS

NuGet version

npm.io

Installation

npm i react-js-snackbar

Usage Example

import React, { Component } from "react";
import ReactSnackBar from "react-js-snackbar";

class Demo extends Component {
  state = {
    Show: false,
    Showing: false
  };

  show = () => {
    if (this.state.Showing) return;

    this.setState({ Show: true, Showing: true });
    setTimeout(() => {
      this.setState({ Show: false, Showing: false });
    }, 2000);
  };
  render() {
    return (
      <div>
        <h1>React Snackbar Demo</h1>
        Click here to: <input type="button" value="Show" onClick={this.show} />
        <ReactSnackBar Icon={<span>🦄</span>} Show={this.state.Show}>
          Hello there, nice to meet you!
        </ReactSnackBar>
      </div>
    );
  }
}