react-quick-alert

1.0.1 • Public • Published

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:

Property Type Default Required Description
time Number n/a yes Duration alert shows
show Boolean n/a yes Trigger to show alert
message String n/a yes Message on alert
resetAlert Function n/a yes Removes visibility
showStyle String n/a yes Class added on show
alertIdentity String n/a yes Unique 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

Readme

Keywords

none

Package Sidebar

Install

npm i react-quick-alert

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

23 kB

Total Files

7

Last publish

Collaborators

  • fwalson