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

ng-toastly

v1.1.0

Published

A modern, lightweight, and accessible toast notification library for Angular 17+ built with Signals and Standalone components.

Readme

npm version License Angular


🚀 Introduction

Toastly is a modern, lightweight, and type-safe toast notification library designed specifically for Angular 17+.

Built from the ground up to leverage the power of Signals and Standalone Components, Toastly provides a developer experience that feels native to the modern Angular ecosystem. It solves the problem of displaying non-intrusive alerts without the bloat of legacy dependencies or heavy UI frameworks.

Whether you need simple success messages or complex notifications with actions and progress bars, Toastly delivers performance and accessibility out of the box.

💡 Why Toastly?

Unlike traditional toast libraries that rely on global state hacks or legacy module systems, Toastly embraces Angular's modern reactivity primitives.

  • Values Signals: State management is reactive and predictable.
  • Zero Magic: No hidden z-index wars or global DOM pollution. You control the container.
  • Micro-Sized: Only ~3KB gzipped.
  • Clean Architecture: Separation of concerns between Service (State) and Component (UI).

✨ Features

  • Angular 17-21 Ready: Built for the latest versions.
  • Type-Safe: Full TypeScript support with strict types.
  • Multi-Position: Support for multiple independently positioned containers (e.g., Top-Left and Bottom-Right simultaneously).
  • A11y First: ARIA live regions, keyboard navigation, and reduced motion support.
  • Dark Mode: Native dark mode support with CSS variables.
  • Customizable: extensive CSS variables and template support for custom content.
  • Interactive: Support for action buttons and hover-pause behavior.

📦 Installation

Install Toastly via npm:

npm install toastly

⚡ Quick Start

1. Register the Service

Toastly is standalone. You don't need to import a generic module. Just add the container to your root component.

// app.component.ts
import { Component, inject } from '@angular/core';
import { ToastContainerComponent, ToastService } from 'ng-toastly';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [ToastContainerComponent],
  template: `
    <button (click)="showToast()">Show Toast</button>

    <!-- The Stage for your Toasts -->
    <toastly-container />
  `,
})
export class AppComponent {
  private toastService = inject(ToastService);

  showToast() {
    this.toastService.success('Hello, World! 🚀');
  }
}

2. Configure (Optional)

You can provide global configuration in your app.config.ts:

// app.config.ts
import { provideToastly } from 'ng-toastly';

export const appConfig = {
  providers: [
    provideToastly({
      position: 'bottom-right',
      theme: 'dark',
      defaultDurationMs: 5000,
    }),
  ],
};

🎨 Customization

Positioning

Toastly supports multiple containers for different notification streams.

<!-- Main notifications at the bottom -->
<toastly-container position="bottom-right" />

<!-- Critical alerts at the top -->
<toastly-container position="top-center" />

When creating a toast, you can target specific positions:

this.toastService.info('Update available', {
  position: 'bottom-right',
});

this.toastService.danger('Connection Lost', {
  position: 'top-center',
});

Styling

Toastly uses CSS variables for easy customization. Override them in your global styles:

:root {
  --toastly-radius: 8px;
  --toastly-font-family: 'Inter', sans-serif;
  --toastly-success: #10b981;
}

[data-theme='dark'] {
  --toastly-bg: #1f2937;
  --toastly-text: #f9fafb;
}

🧠 Design & Philosophy

We believe simple problems deserve simple solutions. Toastly was architected to be readable and maintainable.

  • No any: Every type is defined.
  • No Side Effects: The service doesn't implicitly inject DOM elements. You place the <toastly-container>, keeping architecture explicit.
  • Memory Safe: Timers are automatically cleaned up using Angular's DestroyRef.

♿ Accessibility

Accessibility isn't an afterthought.

  • Containers use role="alert" or role="status" depending on message type.
  • Updates trigger aria-live regions appropriately.
  • Animations respect prefers-reduced-motion.

🔄 Versioning

Toastly follows Semantic Versioning.

  • v1.x: Angular 17+

🤝 Contributing

We welcome contributions! Please see our CONTRIBUTING.md for details on how to set up the dev environment and submit PRs.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.