Skip to content

rodrigoramosrs/react-snackbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snackbar Build For ReactJS

NuGet version

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

About

Animated snackbar build for React.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published