Stylish Toast Notification Library – Saber Toast

Category: Javascript , Notification | December 22, 2022
Author:ahmed0saber
Views Total:705 views
Official Page:Go to website
Last Update:December 22, 2022
License:MIT

Preview:

Stylish Toast Notification Library – Saber Toast

Description:

Yet another toast JavaScript library to create toast-like temporary notification messages, which appear on the screen and then slide out after a short period of time.

One of the great features of the Saber Toast library is its support for RTL (right-to-left) languages. This means that you can use the library to create toast messages in languages such as Arabic or Hebrew, and the messages will be displayed correctly on the screen.

How to use it:

1. Download and import the Saber Toast’s files.

<link rel="stylesheet" href="./saber-toast.css">
<script src="./saber-toast.js"></script>

2. Create toast messages using the saberToast.success and saberToast.error methods. All available parameters:

  • title: Title
  • text: Toast message
  • delay: Delay in ms
  • duration: Duration in ms
  • rtl: RTL mode
  • position: “bottom-right”, “bottom-left”, “top-right”, “top-left”
saberToast.success({
  title: "Success Message",
  text: "This is a Success Toast",
  delay: 200,
  duration: 2600,
  rtl: false,
  position: "top-left"
})
saberToast.error({
  title: "Error Message",
  text: "This is an Error Toast",
  delay: 200,
  duration: 2600,
  rtl: true,
  position: "bottom-right"
})

You Might Be Interested In:


Leave a Reply