A JavaScript prototype for Toast messages

Made with by @IreAderinokun

Getting Started

Create a Toast -

new Toast(options)




The only required option you need to pass is the message that is displayed in the toast. This example below is the Toast that comes up when you first visit this page

new Toast({message: 'Welcome to Toast.js!'});

Toast Style

new Toast({
  message: 'This is a danger message. You can use this for errors etc',
  type: 'danger'

Custom Button Functions

new Toast({
  message: 'This is an example with custom buttons',
  type: 'success',
  customButtons: [
      text: 'Refresh the page',
      onClick: function() {
      text: 'Follow @ireaderinokun',
      onClick: function() {'');