A client-only Meteor package which provides a combination of Bootstrap Toasts and Alerts:
- as toast, the provided message automatically disappear after a (configurable) timeout
- as alert, we may have a distinct color for a distinct information level.
Here the 'tolerts' are displayed on the top-right corner of the window.
Disclaimer: this is not my own idea, but don't remember where I have found that, most probably on SO.
This Meteor package is installable with the usual command:
meteor add pwix:tolert
meteor npm install lodash --saveVery simple indeed. Just import the globally exported object, and enjoy:
import { Tolert } from 'meteor/pwix:tolert';
...
Tolert.info( 'An information message' );The exported Tolert global object provides following items:
All are only available on the client side.
The four previous functions use the corresponding Bootstrap color codes as a colored background of the tolert.
Erase the oldest message.
Note: the oldest message is normally automatically erased after the configured timeout. This method is mainly defined for tests purposes.
This is just a placeholder that you have to include anywhere in your application main layout:
{{> tlMessage }}It will not take any place inside your layout as only (temporarily) visible over the window.
The package's behavior can be configured through a call to the Tolert.configure() method, with just a single javascript object argument, which itself should only contains the options you want override.
Package is very simple, has a single configuration option:
-
stackFromTopWhether the messages are stackable from the top of the screen ?
Defauts to
true.When
false, messages are stacked from the bottom of the screen. -
timeoutThe timeout, in ms, to erase the displayed message.
Defaut value is 3 seconds (3000 ms).
Any value less or equal to zero disables the timeout.
-
verbosityThe verbosity level.
Can be
Tolert.C.Verbose.NONEor an or-ed combination of following values:-
Tolert.C.Verbose.CONFIGURETrace configuration actions and their result.
-
Tolert.C.Verbose.TIMEOUTTrace messages insertions and deletions.
Defaut value is
Tolert.C.Verbose.CONFIGURE. -
Please note, as an explicit reminder, that, because the Meteor packages are instanciated at application level, they can be configured once at most, and only once at most. Each addtionnal call to Tolert.configure() will just override the previous one. You have been warned: only the application should configure a package.
Starting with v 1.1.0, and in accordance with advices from the Meteor Guide, we no more hardcode NPM dependencies in the Npm.depends clause of the package.js.
Instead we check npm versions of installed packages at runtime, on server startup, in development environment.
Dependencies as of v 1.5.0:
'lodash': '^4.17.21'Each of these dependencies should be installed at application level:
meteor npm install <package> --saveNone at the moment.
None at the moment.
In case of support or error, please report your issue request to our Issues tracker.
P. Wieser
- Last updated on 2026, Apr. 2nd



