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-toast

v1.0.3

Published

A lightweight Angular Material-based Snackbar Library that provides beautiful, customizable, and consistent toast notifications throughout your application.

Readme

Dynamic Snackbar

A lightweight Angular Material-based Snackbar Library that provides beautiful, customizable, and consistent toast notifications throughout your application.

The library offers predefined notification types such as Success, Error, Warning, and Information while also allowing fully customizable snackbars through a configuration object.

Feedback / Suggestion / Report issue

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

Features

  • 🚀 Simple API
  • 🎨 Angular Material Snackbar
  • ✅ Success Notifications
  • ❌ Error Notifications
  • ⚠️ Warning Notifications
  • ℹ️ Information Notifications
  • 🎯 Fully Customizable
  • ⏱ Configurable Duration
  • 📍 Configurable Position
  • 🎨 Custom Styling Support
  • ⚡ Lightweight and Fast

Installation

npm install devlab-one-dynamic-snackbar

Inject Snackbar Service

import { SnackbarService } from 'devlab-one-dynamic-snackbar';

constructor(
  private snackbar: SnackbarService
) {}

Available Methods

show(config: SnackbarConfig): void;

success(
  message: string,
  title?: string
): void;

error(
  message: string,
  title?: string
): void;

warning(
  message: string,
  title?: string
): void;

info(
  message: string,
  title?: string
): void;

Success Snackbar

Display success notifications after successful operations.

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

With Title

this.snackbar.success(
  'Employee created successfully',
  'Success'
);

Error Snackbar

Display application or API error messages.

this.snackbar.error(
  'Unable to create employee'
);

With Title

this.snackbar.error(
  'Unable to create employee',
  'Error'
);

Warning Snackbar

Display warning messages.

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

With Title

this.snackbar.warning(
  'You have unsaved changes',
  'Warning'
);

Information Snackbar

Display informational messages.

this.snackbar.info(
  'New update available'
);

With Title

this.snackbar.info(
  'New update available',
  'Information'
);

Custom Snackbar

For complete control over the snackbar appearance and behavior, use the show() method.

this.snackbar.show({
  title: 'Success',
  message: 'Employee created successfully',
  type: 'success'
});

Snackbar Configuration

export interface SnackbarConfig {
  title?: string;
  message: string;
  type?: SnackbarType;
  duration?: number;
  horizontalPosition?: HorizontalPosition;
  verticalPosition?: VerticalPosition;
}

Snackbar Types

export enum SnackbarType {
  Success = 'success',
  Error = 'error',
  Warning = 'warning',
  Info = 'info'
}

Duration Configuration

Default snackbar duration can be overridden.

this.snackbar.show({
  title: 'Success',
  message: 'Employee created successfully',
  duration: 5000
});

Duration is specified in milliseconds.

| Value | Description | | ----- | ----------- | | 3000 | 3 seconds | | 5000 | 5 seconds | | 10000 | 10 seconds |

Position Configuration

Horizontal Position

horizontalPosition: 'start'
horizontalPosition: 'center'
horizontalPosition: 'end'
horizontalPosition: 'left'
horizontalPosition: 'right'

Vertical Position

verticalPosition: 'top'
verticalPosition: 'bottom'

Example

this.snackbar.show({
  title: 'Success',
  message: 'Employee created successfully',
  horizontalPosition: 'right',
  verticalPosition: 'top'
});

Complete Example

this.snackbar.show({
  title: 'Employee Created',
  message: 'Employee record saved successfully',
  type: SnackbarType.Success,
  duration: 5000,
  horizontalPosition: 'right',
  verticalPosition: 'top'
});

API Success Example

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

API Error Example

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

UI Examples

Success

┌──────────────────────────────┐
│ ✓ Success                    │
│ Employee created successfully│
└──────────────────────────────┘

Error

┌──────────────────────────────┐
│ ✕ Error                      │
│ Unable to create employee    │
└──────────────────────────────┘

Warning

┌──────────────────────────────┐
│ ⚠ Warning                    │
│ Unsaved changes detected     │
└──────────────────────────────┘

Information

┌──────────────────────────────┐
│ ℹ Information                │
│ New update available         │
└──────────────────────────────┘

Typical Usage Scenarios

Form Save

this.snackbar.success(
  'Form submitted successfully'
);

API Error

this.snackbar.error(
  'Unable to connect to server'
);

Warning Notification

this.snackbar.warning(
  'Session will expire in 2 minutes'
);

Application Update

this.snackbar.info(
  'Version 2.0 is now available'
);

Built With

  • Angular 21+
  • Angular Material Snackbar
  • TypeScript
  • RxJS

Why Dynamic Snackbar?

Instead of repeatedly configuring Angular Material snackbars throughout your application:

this.snackBar.open(
  message,
  'Close',
  {
    duration: 3000,
    horizontalPosition: 'right',
    verticalPosition: 'top'
  }
);

Simply use:

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

and let the library handle styling, icons, duration, positioning, and consistency automatically.

License

MIT License