Giter Club home page Giter Club logo

toastify's Introduction

Toastify

Build Status npm version npm

Toastify is a lightweight Javascript package written in Typescript. It was created to provide toaster style notifications without any dependencies.

View the blog article here - Zero Dependency Toaster Notifications

Installation

You can install this package by simply running npm install --save toastify or yarn add toastify.

Once this has finished, you can import the package. Below is an example:

import Toastify from "toastify";

Usage

The Toastify package allows you to fire different levels of notifications. At present you can fire: default, info, success, error and warning. To do this you simply call the respective method. For example, to fire a success notification you would do the following:

Toastify.success('Title', 'This is the body of the notification');

As you can see, the first parameter is the title of the notification. The second parameter is the body, which is totally optional.

Configuration

There are a small number of options you can configure in this package. These are the position, delay, element and speed.

To set an option, you can simply call the setOption method. Here is an example:

Toastify.setOption('delay', 10000);

Position

By default, the position is set to bottom-right. However you can alter this to one of the following if you wish: top-left, top-right, bottom-left.

Delay

The delay value determines how long this notification appears on screen before it disappears. The default value is 5 seconds (5000ms). You can alter this to any number you wish.

Speed

The speed value determines how fast the animation is when fading in and fading out notifications. The default speed is 20 - however you can adjust this to suit your needs.

toastify's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

princeahugah

toastify's Issues

Where is demo?

Hello,Where can I find the demo for this project?When I checked the link on the page,it gave me an 404 error...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.