Socket
Socket
Sign inDemoInstall

toastifier

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toastifier

Light and Simple Multi-Framework Toaster


Version published
Maintainers
3
Created
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

Package last updated on 22 May 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc