THEMETRIAL

Beautiful Toast Messages For Vanilla JavaScript

Author:mehmetemineker
Views Total:0 views
Official Page:Go to website
Last Update:January 13, 2021
License:MIT

Preview:

Beautiful Toast Messages For Vanilla JavaScript

Description:

A minimal, beautiful, plug & play toast message library created using pure (vanilla) JavaScript.

See Also:

How to use it:

1. Load the vanilla-toast.min.js script in the document and we’re ready to go.

<script src="https://www.cssscript.com/lib/vanilla-toast.min.js"></script>

2. Create toast messages as follows.

vt.success("Success Message");
vt.info("Info Message");
vt.warn("Warning Message");
vt.error("Error Message");

3. Available options to customize your toast messages.

  • title: Toast Title
  • position: TopCenter, TopLeft, TopRight, BottomCenter, BottomLeft, BottomRight
  • duration: Auto dismiss the toast after 2 seconds
  • closable: Determine whether the toast message is dismissable
  • focusable: Determine whether the toast message is focusable
  • callback: Trigger a function when the toast message is dismissed
vt.success("Success Message",{
  title: undefined,
  position: toastPosition.TopCenter,
  duration: 2000,
  closable: true,
  focusable: true,
  callback: undefined
});


Source link

Add comment

NOTE :

All visitors can share my site’s content on their blogs, sites, and social networks to enrich the content

Only share the source www.themetrial.com

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.