1.3.0 • Published 2 years ago

toastifier v1.3.0

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

Installation

$ npm install --save toastifier
$ yarn add toastifier

Simple Example

import React from "react";

import toastifier from "toastifier";
import "toastifier/dist/toastifier.min.css";

function App() {
  return (
    <div>
      <button onClick={() => toastifier("Alert Check")}>Notify!</button>
    </div>
  );
}

Demo

You can play with our official Demo here

Documentation

Check this to get you started!

NameTypeDescription
typeStringToast Type
animationStringAnimation Category
durationNumberDuration for Animation .
positionStringToast position on window.
onhoverPauseBooleanpasue toast on hover.
showIconBooleanShow default SVG icons on toast
onClickFunctionFunction to trriger events.
styleClassClass ObjectObject for Style Class.
backgroundStringBackground colour, by default white
textStringText Color, by default based on toast type
borderStringBorder, by default based on toast type
onAppearFunctionCallback executes when toast appears
onDisappearFunctionCallback executes when toast disappears

Available options

NameValuesDefault
typeerror, success, warn, infosuccess
animationflip, bounce, fade, zoombounce
positiontop-left, top-center, top-right, bottom-left, bottom-center, bottom-right,top-center
onhoverPausetrue/falsefalse
showIcontrue/falsetrue

Complete Example

import React from "react";

import toastifier from "toastifier";
import "toastifier/dist/toastifier.min.css";

function App() {
  const toastfunction = () => {
    alert("function Trigerred");
  };
  const options = {
    type: "success",
    shadow: false,
    animation: "bounce",
    duration: 3000,
    position: "top-center",
    onhoverPause: true,
    onClick: toastfunction,
    styleClass: {
      background: "#22272e", // dark mode
      text: "#fff",
      border: "#eee",
    },
    onAppear: () => console.log('toast appeared'),
    onDisappear: () => console.log('toast disappeared')
  };
  const notify = () => toastifier("Boom! it Worked", options);

  return (
    <div>
      <button onClick={notify}>Notify!</button>
    </div>
  );
}

Contribute

Show your ❤️ and support by giving a ⭐. Any suggestions are welcome!

Code Contributors

This project exists thanks to all the people who contribute.

1.3.0

2 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.1.2

4 years ago

1.0.11

4 years ago

1.0.12

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago