All Projects → apvarun → Toastify Js

apvarun / Toastify Js

Licence: mit
Pure JavaScript library for better notification messages

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Toastify Js

Toasted Notes
simple, flexible toast notifications for react
Stars: ✭ 241 (-57.72%)
Mutual labels:  notifications, toast
Cogo Toast
Beautiful, Zero Configuration, Toast Messages for React. Only ~ 4kb gzip, with styles and icons
Stars: ✭ 557 (-2.28%)
Mutual labels:  notifications, toast
toaststrap
A simple, lightweight JavaScript library for showing Bootstrap 5 toast popups.
Stars: ✭ 16 (-97.19%)
Mutual labels:  javascript-library, toast
React Notify Toast
Toast notifications for React.js
Stars: ✭ 176 (-69.12%)
Mutual labels:  notifications, toast
php-flasher
🔔 Flasher is a powerful and flexible flash notifications system for PHP, Laravel, Symfony
Stars: ✭ 68 (-88.07%)
Mutual labels:  notifications, toast
Sweetalert2
A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies.
Stars: ✭ 13,929 (+2343.68%)
Mutual labels:  notifications, toast
Sentinel
👀 Native notifications for League of Legends
Stars: ✭ 38 (-93.33%)
Mutual labels:  notifications, toast
Notistack
Highly customizable notification snackbars (toasts) that can be stacked on top of each other
Stars: ✭ 2,562 (+349.47%)
Mutual labels:  notifications, toast
ngx-toasta
Simple and clean Toast notification library for AngularX (Angular2 and beyond)
Stars: ✭ 20 (-96.49%)
Mutual labels:  notifications, toast
tall-toasts
A Toast notification library for the Laravel TALL stack. You can push notifications from the backend or frontend to render customizable toasts with almost zero footprint on the published CSS/JS 🔥🚀
Stars: ✭ 296 (-48.07%)
Mutual labels:  notifications, toast
Angular Notifier
A well designed, fully animated, highly customizable, and easy-to-use notification library for your Angular application.
Stars: ✭ 175 (-69.3%)
Mutual labels:  notifications, toast
Ftindicator
A light wight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes support.
Stars: ✭ 292 (-48.77%)
Mutual labels:  notifications, toast
Notiflix
Notiflix is a JavaScript library for client-side non-blocking notifications, popup boxes, loading indicators, and more that makes your web projects much better.
Stars: ✭ 172 (-69.82%)
Mutual labels:  notifications, toast
Overlay support
a flutter toast and notification library
Stars: ✭ 232 (-59.3%)
Mutual labels:  notifications, toast
React Toast Notifications
🍞 A toast notification system for react
Stars: ✭ 2,103 (+268.95%)
Mutual labels:  notifications, toast
vue-dk-toast
Lightweight toast-notification plugin for Vue 3 🍞
Stars: ✭ 23 (-95.96%)
Mutual labels:  notifications, toast
Svelte Notifications
Svelte toast notifications component that can be used in any JS application
Stars: ✭ 146 (-74.39%)
Mutual labels:  notifications, toast
Notyf
👻 A minimalistic, responsive, vanilla JavaScript library to show toast notifications.
Stars: ✭ 2,093 (+267.19%)
Mutual labels:  notifications, toast
SteamAchievementNotifier
Steam Achievement Notifier is an Electron application that shows a customisable notification when you unlock any Steam Achievement! It uses the Steam Web API to track achievement stats in real time, and displays an achievement summary within the notification.
Stars: ✭ 77 (-86.49%)
Mutual labels:  notifications, toast
Razor.SweetAlert2
A Razor class library for interacting with SweetAlert2
Stars: ✭ 98 (-82.81%)
Mutual labels:  notifications, toast

Toastify

forthebadge forthebadge

toastify-js

Toastify is a lightweight, vanilla JS toast notification library.

Demo

Click here

Features

  • Multiple stacked notifications
  • Customizable
  • No blocking of execution thread

Customization options

  • Notification Text
  • Duration
  • Toast background color
  • Close icon display
  • Display position
  • Offset position

Installation

Toastify now supports installation via NPM

  • Run the below command to add toastify-js to your exisitng or new project.
npm install --save toastify-js

or

yarn add toastify-js -S
  • Import toastify-js into your module to start using it.
import Toastify from 'toastify-js'

You can use the default CSS from Toastify as below and later override it or choose to write your own CSS.

import "toastify-js/src/toastify.css"

Adding ToastifyJs to HTML page using the traditional method

To start using Toastify, add the following CSS on to your page.

<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css">

And the script at the bottom of the page

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js"></script>

Files are delivered via the CDN service provided by jsdeliver

Documentation

Toastify({
  text: "This is a toast",
  duration: 3000,
  destination: "https://github.com/apvarun/toastify-js",
  newWindow: true,
  close: true,
  gravity: "top", // `top` or `bottom`
  position: "left", // `left`, `center` or `right`
  backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
  stopOnFocus: true, // Prevents dismissing of toast on hover
  onClick: function(){} // Callback after click
}).showToast();

Toast messages will be centered on devices with screen width less than 360px.

Add own custom classes

If you want to use custom classes on the toast for customizing (like info or warning for example), you can do that as follows:

Toastify({
  text: "This is a toast",
  backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
  className: "info",
}).showToast();

Multiple classes also can be assigned as a string, with spaces between class names.

Add some offset

If you want to add offset to the toast, you can do that as follows:

Toastify({
  text: "This is a toast with offset",
  offset: {
    x: 50, // horizontal axis - can be a number or a string indicating unity. eg: '2em'
    y: 10 // vertical axis - can be a number or a string indicating unity. eg: '2em'
  },
}).showToast();

Toast will be pushed 50px from right in x axis and 10px from top in y axis.

Note:

If position is equals to left, it will be pushed from left. If gravity is equals to bottom, it will be pushed from bottom.

API

Option Key type Usage Defaults
text string Message to be displayed in the toast "Hi there!"
node ELEMENT_NODE Provide a node to be mounted inside the toast. node takes higher precedence over text
duration number Duration for which the toast should be displayed.
-1 for permanent toast
3000
selector string CSS Selector on which the toast should be added body
destination URL string URL to which the browser should be navigated on click of the toast
newWindow boolean Decides whether the destination should be opened in a new window or not false
close boolean To show the close icon or not false
gravity "top" or "bottom" To show the toast from top or bottom "top"
position "left" or "right" To show the toast on left or right "right"
backgroundColor CSS background value Sets the background color of the toast
avatar URL string Image/icon to be shown before text
className string Ability to provide custom class name for further customization
stopOnFocus boolean To stop timer when hovered over the toast (Only if duration is set) true
callback Function Invoked when the toast is dismissed
onClick Function Invoked when the toast is clicked
offset Object Ability to add some offset to axis

Browsers support


IE / Edge

Firefox

Chrome

Safari

Opera
IE10, IE11, Edge last 10 versions last 10 versions last 10 versions last 10 versions

Contributors

caiomoura1994
caiomoura1994
rndevfx
rndevfx
1ess
1ess
d4rn0k
d4rn0k
danielkaiser80
danielkaiser80
skjnldsv
skjnldsv
chasedeanda
chasedeanda
Wachiwi
Wachiwi
gavinhungry
gavinhungry
haydster7
haydster7
joaquinwojcik
joaquinwojcik
juliushaertl
juliushaertl
mort3za
mort3za
Sandip124
Sandip124
Tadaz
Tadaz
t12ung
t12ung
victorfeijo
victorfeijo
fiatjaf
fiatjaf
prousseau-korem
prousseau-korem

License

MIT © Varun A P

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].