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:
Feel free to make feature requests in the new repo.
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:
Example:
Feel free to make feature requests in the new repo.