npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng2-izitoast

v2.0.0

Published

Elegant, responsive, flexible and lightweight notification plugin implemented for angular 2 of iziToast

Downloads

615

Readme

Ng2Izitoast

Elegant, responsive, flexible and lightweight notification plugin implemented for angular 2 of iziToast

izitoast.marcelodolce.com

capa

Install

npm install ng2-izitoast --save

Configuration

in angular-cli.json add the script and css lines

...
"styles": [
    "../node_modules/izitoast/dist/css/iziToast.min.css"
],
"scripts": [
    "../node_modules/izitoast/dist/js/iziToast.min.js"
],
...

Running

in app.module.ts add

import { Ng2IziToastModule } from 'ng2-izitoast';//<-- this line

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    Ng2IziToastModule//<-- this line
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

now in app.component.ts add

...
constructor(public iziToast: Ng2IzitoastService) {}
...

...
this.iziToast.show({title: "Welcome"});
...

All options applicable to ng2-izitoast

Argument | Default Value | Description :---: | :---: | --- class | '' | The class that will be applied to the toast. It may be used as a reference. title | '' | Title of the toast. titleColor | '' | Title color. titleSize | '' | Title fontSize. titleLineHeight | '' | Title lineHeight. message | '' | Message of the toast. messageColor | '' | Message color. messageSize | '' | Message fontSize. messageLineHeight | '' | Message lineHeight. backgroundColor | '' | Background color of the Toast. theme | light | It can be light or dark or set another class. Create and use like this ".iziToast-theme-name" color | '' | It can be #hexadecimal, pre-defined themes like blue, red, green and yellow or set another class. Create and use like this ".iziToast-color-name". icon | '' | Icon class (font-icon of your choice, Icomoon, Fontawesome etc.). iconText | '' | Icon text (font-icon using text, Material Ithemecons, etc.). iconColor | '' | Icon color. image | '' | Cover image. imageWidth | 50 | Width of cover image maxWidth | null | set maxWidth of toast zindex | 99999 | The z-index CSS attribute of the toast. layout | 1 | It can be 1 or 2, or use another layout, creating the class like this: ".iziToast-layout3" balloon | false | Applies a balloon like toast. close | true | Show "x" close button. closeOnEscape | false | Allows to close toast using the Esc key. rtl | false | RTL option. position | 'bottomRight' | Where it will be shown. It can be bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter or center. target | '' | Fixed place where you want to show the toasts. targetFirst | true | Add toast to first position toastOnce | false | Waits for another toast to be closed on 'onClosed' function. You'll need an ID to use it. timeout | 5000 | Amount in milliseconds to close the toast or false to disable. drag | true | Drag Feature. Is used to close the toast. pauseOnHover | true | Pause the toast timeout while the cursor is on it. resetOnHover | false | Reset the toast timeout while the cursor is on it. progressbar | true | Enable timeout progress bar. progressbarColor | '' | Progress bar color. progressBarEasing | linear | Animation Easing of progress bar. overlay | false | Enables display the Overlay layer on the page. overlayClose | false | Allows to close toast clicking on the Overlay. overlayColor | rgba(0, 0, 0, 0.6) | Overlay background color. animateInside | true | Enable animations of elements in the toast. transitionIn | 'fadeInUp' | Default toast open animation. It can be: bounceInLeft, bounceInRight, bounceInUp, bounceInDown, fadeIn, fadeInDown, fadeInUp, fadeInLeft, fadeInRight or flipInX. transitionOut | 'fadeOut' | Default toast close animation. It can be: fadeOut, fadeOutUp, fadeOutDown, fadeOutLeft, fadeOutRight, flipOutX transitionInMobile | 'fadeInUp' | Default toast opening mobile transition. transitionOutMobile | 'fadeOutDown' | Default toast closing mobile transition. onOpening | function() {} | Callback function triggered when opening the toast. onOpened | function() {} | Callback function triggered when onOpened the toast. onClosing | function() {} | Callback function triggered when closing the toast. onClosed | function() {} | Callback function triggered when closed the toast.

Examples

Question

...
constructor(public iziToast: Ng2IzitoastService) {}
...

...
this.iziToast.question({
  title: "Welcome",
  progressBarColor: "red",
  onOpened: () => {
    console.log("opened");
  }
});
...

Progress

...
constructor(public iziToast: Ng2IzitoastService) {}
...

...
this.iziToast.question({
  title: "Welcome",
  class: "foo",
  progressBarColor: "red",
  onOpened: () => {
    console.log("opened");
  }
});

this.iziToast.progress(".foo").pause();
this.iziToast.progress(".foo").resume();
this.iziToast.progress(".foo").reset();
this.iziToast.progress(".foo").start();
...

Hide

...
constructor(public iziToast: Ng2IzitoastService) {}
...

...
this.iziToast.show({
  title: "Welcome",
  class: "foo",
  progressBarColor: "red",
  onClosed: () => {
    console.log("closed");
  }
});

this.iziToast.hide(".foo");
...