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

devlab-one-dynamic-alert

v1.0.6

Published

A lightweight Angular Material-based Alert Library that provides beautiful and consistent alert dialogs for common application scenarios such as:

Downloads

1,029

Readme

Dynamic Alert

A lightweight Angular Material-based Alert Library that provides beautiful and consistent alert dialogs for common application scenarios such as:

  • Success Messages
  • Error Messages
  • Information Messages
  • Warning Messages
  • Confirmation Dialogs

The library eliminates the need to manually create dialog components for simple notifications and confirmation popups.

Feedback / Suggestion / Report issue

https://github.com/AravindhanSenthilkumar/Feedback/issues/1

Features

  • 🚀 Simple API
  • 🎨 Angular Material Design
  • ✅ Success Alerts
  • ❌ Error Alerts
  • ℹ️ Information Alerts
  • ⚠️ Warning Alerts
  • 🤔 Confirmation Dialogs
  • 🔄 Callback Support
  • 📝 Supports String Messages
  • 📋 Supports Structured Error Messages
  • ⚡ Zero Configuration

Installation

npm install devlab-one-dynamic-alert

Inject Alert Service

import { AlertService } from 'devlab-one-dynamic-alert';

constructor(
  private alertService: AlertService
) {}

Available Methods

success(
  message: string | IErrorMessage,
  okCallback?: () => void
): void;

error(
  message: string | IErrorMessage,
  okCallback?: () => void
): void;

info(
  message: string | IErrorMessage,
  okCallback?: () => void
): void;

warning(
  message: string | IErrorMessage,
  okCallback?: () => void
): void;

confirmationModel(
  message: string | IErrorMessage,
  okCallback?: () => void,
  cancelCallback?: () => void
): void;

Success Alert

Display a success message after a successful operation.

this.alertService.success(
  'Employee created successfully'
);

With Callback

this.alertService.success(
  'Employee created successfully',
  () => {
    this.loadEmployees();
  }
);

Error Alert

Display application or API error messages.

this.alertService.error(
  'Unable to save employee details'
);

With Callback

this.alertService.error(
  'Unable to save employee details',
  () => {
    console.log('Error acknowledged');
  }
);

Information Alert

Display informational messages to the user.

this.alertService.info(
  'New application update is available'
);

With Callback

this.alertService.info(
  'New application update is available',
  () => {
    console.log('Information viewed');
  }
);

Warning Alert

Display warning messages before a critical action.

this.alertService.warning(
  'You have unsaved changes'
);

With Callback

this.alertService.warning(
  'You have unsaved changes',
  () => {
    console.log('Warning acknowledged');
  }
);

Confirmation Dialog

Display a confirmation popup before performing an action.

this.alertService.confirmationModel(
  'Are you sure you want to delete this employee?'
);

With Confirm Callback

this.alertService.confirmationModel(
  'Are you sure you want to delete this employee?',
  () => {
    this.deleteEmployee();
  }
);

With Confirm and Cancel Callback

this.alertService.confirmationModel(
  'Are you sure you want to delete this employee?',
  () => {
    console.log('Confirmed');
  },
  () => {
    console.log('Cancelled');
  }
);

Using Structured Error Messages

The library supports both string messages and structured error objects.

export interface IErrorMessage {
  title?: string;
  message: string;
  errors?: string[];
}

Example

const error: IErrorMessage = {
  title: 'Validation Error',
  message: 'Unable to submit the form',
  errors: [
    'Name is required',
    'Email is invalid'
  ]
};

this.alertService.error(error);

Alert Types

| Method | Description | | ------------------- | ------------------------ | | success() | Success notification | | error() | Error notification | | info() | Information notification | | warning() | Warning notification | | confirmationModel() | Confirmation dialog |

Callback Flow

Success

this.alertService.success(
  'Saved Successfully',
  () => {
    console.log('OK Clicked');
  }
);

Confirmation

this.alertService.confirmationModel(
  'Delete Employee?',
  () => {
    console.log('Confirmed');
  },
  () => {
    console.log('Cancelled');
  }
);

UI Examples

Success Alert

✓ Success

Employee saved successfully

          [ OK ]

Error Alert

✕ Error

Unable to save employee

          [ OK ]

Information Alert

ℹ Information

New update available

          [ OK ]

Warning Alert

⚠ Warning

Unsaved changes detected

          [ OK ]

Confirmation Dialog

? Confirmation

Are you sure you want to delete this record?

    [ Cancel ] [ Confirm ]

Typical Usage Scenarios

API Success

this.employeeService.create(employee)
  .subscribe({
    next: () => {
      this.alertService.success(
        'Employee created successfully'
      );
    }
  });

API Error

this.employeeService.create(employee)
  .subscribe({
    error: () => {
      this.alertService.error(
        'Unable to create employee'
      );
    }
  });

Delete Confirmation

this.alertService.confirmationModel(
  'Delete selected employee?',
  () => {
    this.deleteEmployee();
  }
);

Built With

  • Angular 21+
  • Angular Material Dialog
  • TypeScript
  • RxJS

License

MIT License