# Toast - A Bootstrap 4.2+ jQuery plugin * [About](#about) * [Usage](#usage) * [Live Example](https://jsfiddle.net/e4nyhsL6/) * [Caveats](#caveats) * [Roadmap](#roadmap) * [Contributing](#contributing) ### About As of Bootstrap 4.2, [toasts](https://getbootstrap.com/docs/4.2/components/toasts/) have been introduced and the aim of this plugin is to make them easier to use. ### Usage You can pass to the `$.toast` function an object with the settings for your toast which are as follows: | Parameter |Description| Default | Values | | ------------- |-----------| ------- |---------| | title | Shows in the top left corner of the toast header | 'Notice!'| | | subtitle | Shows in the top right corner of the toast header | N/A | | | content | Shows in the toast body | N/A | | | type | Determines the style of the toast based on Bootstrap styles | 'info' | 'info', 'success', 'warning', 'error' | | delay | Determines how long the Toast shoud be shown for. The default, -1, will show the toast until the user clicks close. | -1 | omit or set to -1 to disable auto close, or timeout value in milliseconds | img | Shows an image before the title | N/A | { src: '', class: '', title: '', alt: '' } | pause_on_hover| true/false respectively to pause on hover | false | true/false | | container | Set the container inside which the toasts will be displayed | $("body") | A JQuery selector | **Note:** If content is omitted, the toast will not have a `.toast-body` and can be used as a small snack which will be shown below in the examples. By default toasts will be positioned in the top right corner and will in the future (hopefully) have other position options. ```javascript $.toast({ title: 'Toast', subtitle: '11 mins ago', content: 'Hello, world! This is a toast message.', type: 'info', delay: 5000 }); ``` ![Example #1](https://i.gyazo.com/20fbdf05b57af4a76e28f66047fe6591.png) The respective markdown for the above would be: ```