Skip to content

tabrezansari/ic-react-toast

Repository files navigation

ic-react-toast

npm version MIT license

Introduction

ic-react-toast is a toast notification library for react applications.

There are four types of toast available with this package.

1. Toaster.success(msg)
2. Toaster.warning(msg)
3. Toaster.error(msg)
4. Toaster.info(msg)

Install

$ npm install ic-react-toast

Usage

import React, { Component } from 'react';
import {ToastContainer,Toaster} from 'ic-react-toast';

// ...

render() {
  return (
    <div>
      <button onClick={() => Toaster.success('Yay!!! You did it')}>Toast</button>
      <button onClick={() => Toaster.warning('Wrong credential detected.')}>Toast</button>
      <button onClick={() => Toaster.error('Cannot post data')}>Toast</button>
      <button onClick={() => Toaster.info('login to start hacking.')}>Toast</button>
      
      <ToastContainer />
    </div>
  );
}

About

A toast notification library for react applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published