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 codebuild/
folder contents to your project.toast.min.css
after Bootstrap's CSS file.toast.min.js
after Bootstrap's JS file.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 |
pause_on_hover | boolean |
Pauses the toast and does not disappear until it's hovered | false |