1.0.7 • Published 7 months ago

easy-notify-ts v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

ISC License

easy-notify-ts

easy-notify-ts is a simple and lightweight JavaScript library for displaying toast notifications in your web applications. It allows you to easily show alert, error, or success messages in a customizable and stylish manner. This library is written in TypeScript and provides an intuitive way to notify your users about important events or messages.

Demo

Demo

Screenshots

npm.io

Installation

You can install easy-notify-ts via npm:

npm install easy-notify-ts

Usage

Here's how you can use the library in your web application:

import { NotificationType, renderToastNotification } from "easy-notify-ts";

// Create a notification object

const notification: ToastNotification = {
  type: NotificationType.Success, // Choose from Alert, Error, or Success
  title: "Notification Title",
  content: "This is the notification content.",
  color: "#3f8860", // Optional: Set a custom background color
};

// Display the notification
renderToastNotification(notification);

API

API NotificationType An enum defining the types of notifications:

  • Alert: Represents an alert notification.
  • Error: Represents an error notification.
  • Success: Represents a success notification.
  • type: The type of notification (one of the values from NotificationType).
  • title: The title of the notification.
  • content: The content or message of the notification.
  • color (optional): A custom background color for the notification.

Notification Types

TypeColor
Alert#e67e22#e67e22
Error#c0392b#c0392b
Success#3f8860#3f8860

Authors

License

ISC

Thank you for using Easy-Notify-TS! We hope it simplifies the way you handle notifications in your TypeScript projects. If you have any questions or need assistance, feel free to reach out to us.

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago