1.0.1 • Published 4 years ago

react-quick-alert v1.0.1

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

react-quick-alert

Lightweight react snackbar.

NPM JavaScript Style Guide

Install

npm install --save react-quick-alert

Usage

Demo

Demo Example Code Here

  this.state = {
    alertShown: false,
    alertMessage: ''
  };
  showAlert(msg) {
    this.setState({ alertMessage: msg, alertShown: true });
  }
  resetAlert() {
    this.setState({ alertShown: false });
  } 

Alert's visibility and message is controlled by solely by function and String passed in by the parent so that the event can easily add customization.

For more details, check out the API below.

Component API

<QuickAlert> component:

PropertyTypeDefaultRequiredDescription
timeNumbern/ayesDuration alert shows
showBooleann/ayesTrigger to show alert
messageStringn/ayesMessage on alert
resetAlertFunctionn/ayesRemoves visibility
showStyleStringn/ayesClass added on show
alertIdentityStringn/ayesUnique id for snackbar

Support or Contact

Any questions? Check out our documentation or contact support and we’ll help you sort it out.

License

MIT © calabashlabsllc