Script47 / Toast

A Bootstrap 4.2+ jQuery plugin for the toast component
https://shrtn.onl/EY
MIT License
152 stars 43 forks source link

Bootstrap 5 - The future #39

Closed Script47 closed 3 years ago

Script47 commented 3 years ago

Folks,

It's been a minute.

I've begun work on Bootstrap 5 support. The intention for this is to branch out to other components too (e.g. modals, toasts, snacks) as such, I've made it a separate repository which you can find over here, though, nothing is in the repo, work is well underway locally:

/***
 * Overridable globals
 ***/
Bs5Utils.defaults.toasts.position = 'top-right'; // top-left, top-center, top-right, middle-left, middle-center, middle-right, bottom-left, bottom-center, bottom-right
Bs5Utils.defaults.toasts.container = 'toast-container';

const bs5Utils = new Bs5Utils();

bs5Utils.Snack.show('info', 'Hello World!');
bs5Utils.Snack.show('success', 'Hello World!');
bs5Utils.Snack.show('warning', 'Hello World!');
bs5Utils.Snack.show('error', 'Hello World!');

// A neater way to register your own styles to components
bs5Utils.Snack.addStyle('pink-purple', ['text-purple', 'bg-pink']);

// Now use the newly registered style
// bs5Utils.Snack.show(type, title, delay = 0, dismissible = true)
bs5Utils.Snack.show('pink-purple', 'Hello Custom Style!', false, false);

Example:

image

Feel free to make feature requests in the new repo.

Script47 commented 3 years ago

v1.0.0 has been released: https://github.com/Script47/bs5-utils