Socket
Socket
Sign inDemoInstall

toastifier

Package Overview
Dependencies
0
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    toastifier

Light and Simple Multi-Framework Toaster


Version published
Weekly downloads
3
Maintainers
3
Install size
82.1 kB
Created
Weekly downloads
 

Readme

Source

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


Image


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

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",
    },
  };
  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.

Keywords

FAQs

Last updated on 10 Sep 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc