JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20
  • Score
    100M100P100Q62146F
  • License MIT

Push notifications to your visitors with a toast, a lightweight and easily customizable alert message with custom theme based.

Package Exports

  • ngx-toast-notify
  • ngx-toast-notify/package.json

Readme

Welcome to ngx-toast-notify!

ngx-toast-notify npm version ngx-toast-notify

Push notifications to your visitors with a toast, a lightweight and easily customizable alert message with custom theme based.

Features: Positioned toast notifications with allows custom theme as responsive

Install: npm install ngx-toast-notify



Import

Import the module on your app.module.ts file as follow.

import { NgxToastNotifyModule , NgxToastNotifyService } from "ngx-toast-notify";

@NgModule({
declarations: [AppComponent],
imports: [
    BrowserModule,
    AppRoutingModule,
    NgxToastNotifyModule.forRoot({
            toastTimeoutInSeconds:  10,
            animationDelayInMilliSeconds:  500,
            enableClosebutton:  true,
            position:  'top-right',
            backgroundColor:  '',
            textColor:  ''
    })
],
providers: [NgxToastNotifyService],
bootstrap: [AppComponent]
})

On a component or service inject the toast service as follows

import { NgxToastNotifyService } from 'ngx-toast-notify';

constructor(private  toast: NgxToastNotifyService) {}

public showToastTopRight() {
    this.toast.showToast('Toast text', 'warning', 'top-right');
}
Workflow:
showToast(text: string, mode: string, position: string): Creates toast notification.

text  — : Toast text to be shown. - String
mode  — : Toast appearance as - primary | warning | danger | success | info - String
position  — : Toast position at - top-left | top-right | bottom-left | bottom-right | top-center | bottom-center