Hello, world! :)

This is just a simple plugin which allows to dynamically create Bootstrap Toasts from javascript.


Supported Bootstrap versions:

Older versions than v4.2 are not supported.

Source code
Installation
  1. Download the latest version from Github
  2. Extract the zip file.
  3. Copy the build/ folder contents to your project.
  4. Include the toast.min.css after Bootstrap's CSS file.
  5. Include the toast.min.js after Bootstrap's JS file.
Usage
new BsToast({
    title: 'Toast title',
    subtitle: 'Toast subtitle',
    content: 'Toast content',
    type: 'Toast type',
    delay: 5000,
    img: {
        src: 'https://via.placeholder.com/25',
        class: 'rounded',
        title: 'Thumbnail Title',
        alt: 'Alternative'
    }
});
type Description Note Default value
title string The Toast's title Can be null or empty Notice!
subtitle string The Toast's subtitle Can be null or empty ''
content string The Toast's content Can be null or empty ''
type string The Toast's type Can be info, success, warning, danger info
delay number The Toast's delay until it disappears Can be null -1
position string The Toast's location where it will appear Can be top-right, top-left, top-center, bottom-right, bottom-left, bottom-center top-right
img object An image that will appear in the Toasts header See demo null
icon html string An icon that will appear in the Toasts header See demo undefined
pause_on_hover boolean Pauses the toast and does not disappear until it's hovered false
customClass string Adds a class to the .toast div. When it's defined the type parameter will be ignored. undefined