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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-toastr-message

v0.7.0

Published

Latest version available for each version of Angular <table style="border:1px solid"> <tr> <th style="border:1px solid">ngx-toastr-message</th> <th>Angular</th> </tr> <tr> <td style="border:1px solid">0.4.0</

Downloads

89

Readme

ngx-toastr-message

A lightweight, customizable Angular library for displaying toast notifications.

Dependencies

Latest version available for each version of Angular

Install

npm i ngx-toastr-message

Setup

app.component.ts

import {
  NgxToastrMessageComponent,
  NgxToastrMessageService,
} from 'ngx-toastr-message';
@Component({
  selector: 'app-root',
  standalone: true,
  imports: [NgxToastrMessageComponent],
  templateUrl: './app.component.html',
  styleUrl: './app.component.scss',
})

Use

app.component.html

<lib-ngx-toastr-message></lib-ngx-toastr-message>

app.component.ts

private toastrService = inject(NgxToastrMessageService);
showMessage() {
    this.toastrService.show('This is a success message!', 'success');
}

Options

this.toastrService.show('This is a success message!', 'success');
this.toastrService.show('This is a error message!', 'error');
this.toastrService.show('This is a info message!', 'info');
this.toastrService.show('This is a warning message!', 'warning');
  1. Change the font size; it should be in pixels.
this.toastrService.show('This is a success message!', 'success', {
  fontSize: 14
});
  1. Change the font family.
this.toastrService.show('This is a success message!', 'success', {
  fontSize: 14,
  font: 'arial',
});

Available fonts:

roboto: "'Roboto', sans-serif",
arial: "Arial, sans-serif",
verdana: "Verdana, sans-serif",
tahoma: "Tahoma, sans-serif",
georgia: "Georgia, serif",
times: "'Times New Roman', serif",
courier: "'Courier New', monospace",
trebuchet: "'Trebuchet MS', sans-serif",
lucida: "'Lucida Sans Unicode', sans-serif",
impact: "Impact, sans-serif",
  1. Change the duration (in milliseconds):
this.toastrService.show('This is a success message!', 'success', {
  duration: 5000 // Shows for 5 seconds
});
  1. Customizable positions and small presets
this.toastrService.show('This is a success message!', 'success', {
  fontSize: 10,
  font: 'impact',
  duration: 2000,
  position: 'bottom-left'
});

Positions:

/* Positions */
.top-right    { top: 20px; right: 20px; }
.top-left     { top: 20px; left: 20px; }
.bottom-right { bottom: 20px; right: 20px; }
.bottom-left  { bottom: 20px; left: 20px; }
.top-center   { top: 20px; left: 50%; transform: translateX(-50%); }
.bottom-center{ bottom: 20px; left: 50%; transform: translateX(-50%); }
  1. Customizable Toastr Icons

You can now customize the icons displayed in your toastr messages.

Install Font Awesome Install Font Awesome version 4.7.0:

npm install [email protected] --save

Import Font Awesome CSS

In your angular.json file, add the Font Awesome stylesheet under the styles array (if not already included):

"styles": [
  "node_modules/font-awesome/css/font-awesome.min.css",
  "src/styles.css"
]

This enables the default icon according to the message type (success, warning, info, error).

Examples Enable the default icon

this.toastrService.show('This is a success message!', 'success', {
  icon: true
});

Disable the icon

this.toastrService.show('This is a success message!', 'success', {
  icon: false
});

Add a custom icon

this.toastrService.show('This is a success message!', 'success', {
  icon: 'fa fa-check'
});
  1. Show a progress bar and Change progress bar color
this.toastrService.show('Uploading file...', 'info', {
  showProgressBar: true // Displays a bottom progress indicator
});
this.toastrService.show('Processing data...', 'info', {
  showProgressBar: true,
  progressBarColor: '#4caf50' // Green progress bar
});
  1. Show close button
this.toastrService.show('Error occurred while saving!', 'error', {
  showCloseButton: true // Adds a close (×) button
});

License

MIT