The world's tastiest notification widget (Part of the tasty framework)
You can find a small demo here.
You can get it on npm.
npm install tasty-toast --save
Or bower, too.
bower install tasty-toast --save
If you're not using either package manager, you can use
tasty-toast by downloading the files in the
tasty-toast in the end of
Including the CSS
tasty-toast provides the easiest possible API to make notifications breeze in your applications.
You can provide
options to customize
tasty-toast. Here's an overview of the default values.
The options are detailed below.
options.type property will give the notification the correct appearance.
tasty-toast has no type. You can set the type of notification by setting the
options.type accepts 'success' or 'error'
If you want to show an icon beside your notification just pass in an URL to an image like this:
options.icon accepts a string as input and ignores all other types.
"Hey there" as the title text. You can change the title text by sending them in to the options at initialization:
options.title accepts a string as input and ignores all other types.
"You didn't fill out the content." as content. You can change the content by sending them in to the options at initialization:
options.content accepts a string as input. You can use HTML here... just sayin
tasty-toast has a duration of 6000 miliseconds. You can set your own duration by setting the duration property at initialization:
options.duration accepts a number as input. The number represents the duration in miliseconds
options.onclick you can set a custom action when the notification object is clicked!
options.onclick accepts a function as input