Gathering detailed insights and metrics for toast-me
Gathering detailed insights and metrics for toast-me
Gathering detailed insights and metrics for toast-me
Gathering detailed insights and metrics for toast-me
react-toast-me
React notification toasts
react-native-toast-me
A real react-native simple toast message handler
@pile-ui/toast
Now I’m the model of a modern major general / The venerated Virginian veteran whose men are all / Lining up, to put me up on a pedestal / Writin’ letters to relatives / Embellishin’ my elegance and eloquence / But the elephant is in the room / The truth i
@rory-ui/toast
Now I’m the model of a modern major general / The venerated Virginian veteran whose men are all / Lining up, to put me up on a pedestal / Writin’ letters to relatives / Embellishin’ my elegance and eloquence / But the elephant is in the room / The truth i
npm install toast-me
Typescript
Module System
Node Version
NPM Version
70.5
Supply Chain
99.3
Quality
76.2
Maintenance
100
Vulnerability
100
License
JavaScript (86.61%)
SCSS (13.39%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
4 Stars
251 Commits
1 Forks
1 Watchers
3 Branches
2 Contributors
Updated on Feb 08, 2023
Latest Version
1.5.0
Package Id
toast-me@1.5.0
Unpacked Size
42.64 kB
Size
13.99 kB
File Count
18
NPM Version
9.5.0
Node Version
18.15.0
Published on
Mar 27, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
45
Tiny, easy to use tool to show toast-like notifications on the web page.
You can read the CHANGELOG.
yarn add toast-me
# or
npm install toast-me
1import toast from 'toast-me';
1toast('My message'); 2// or with the instance 3const toastInstance = toast('My message');
1toast('My message', { duration: 3000, toastClass: 'my-toast-class' /* ... */ });
1toast('My message', 'error');
1toast( 2 'My message', 3 { duration: 1000 }, 4 { 5 label: 'Confirm', 6 action: () => alert('Cool!'), 7 class: 'my-custom-class', // optional, CSS class name for action button 8 }, 9);
1toast( 2 'My message', 3 null, 4 { 5 label: 'Confirm', 6 action: () => alert('Cool!'), 7 }, 8);
1toast( 2 '<i>My message</i> ☻', 3 { useUnsafeHtmlContent: true }, 4);
1const uniqId = 'messageRoot_' + Math.random().toString().slice(2); 2 3toast(`<div id="${uniqId}" />`, { useUnsafeHtmlContent: true }); 4 5ReactDOM.render( 6 <div>My message</div>, 7 document.getElementById(uniqId) 8)
1toast(message, [options, [action]]);
Function accepts three arguments:
message
- message to show in toast,options
- toast customization options,action
- some action button options.Returns instance of ToastMeClass. You can learn method of it here
Accepts string
, any message to put in toast.
Text shown in one line, no wraps allowed.
Overflowed text will be hidden with ellipsis.
Complete text shown on hover with the title
attribute on toast node.
Optional. Accepts object
with any allowed fields, or string
as a name of options preset, or null
.
If you don't need to set options, but need to pass an action - pass null
instead options.
Default options preset (all available options with their default values):
1const defaults = { 2 position: 'top', 3 type: 'over', 4 toastClass: '', 5 removedToastClass: '', 6 containerClass: '', 7 useUniqueContainer: false, 8 useUnsafeHtmlContent: false, 9 closeable: true, 10 timeoutOnRemove: 1000, 11 duration: 5000, 12}
position
- string, one of "top"
"bottom"
. Default "top"
.type
- string, one of "over"
"chain"
. When "chain"
- all messages shown in line,
and when "over"
- message covers previous. Default "over"
. NOTE: when you use
toasts of different types in one app - that could cause toast display collisions.toastClass
- string, CSS class name for toast node, can be used for custom toast styling.
Default ""
- empty stringremovedToastClass
- string, CSS class name for removed toast node, can be used for custom CSS
animation or styling. Default ""
- empty stringcontainerClass
- string, CSS class name for toast's container node, can be used for custom
container styling. Once it is set, container node will have that class (classname won't be erased
on next toast creating). If you want prevent this behaviour - set useUniqueContainer
option
to true
when set containerClass
. Default ""
- empty stringuseUniqueContainer
- boolean, create new toast's container node, instead of re-using existing
one, if it is presented. Default false
useUnsafeHtmlContent
- boolean, allows passing HTML string as content. Default false
closeable
- boolean, enables/hides "close" button on toast. Default true
timeoutOnRemove
- number, time in ms, till node should be removed from DOM after toast hides.
Can be useful when you change hide animation by CSS and set new animation duration.
To avoid element disappearing until animation ends set this option to larger or equal
value than animation duration. Default 1000
duration
- number, time in ms, how long should toast be shown. Default 5000
default
- all default options,error
- everything default, except background color - #D40D00
, set by CSS class.Optional. Accepts object with three fields:
label
- string, text to put in button.action
- callback function - to be called on button click.class
- string, CSS class for button node.Has methods:
close()
- Closes current toast.startTimer()
- Starts/restarts timer with timeout, set in options object on toast create.stopTimer()
- Stops timer, the toast won't disappear. After calling this
you should handle toast's behavior by yourself
(i.e. with close()
method).1import toast from 'toast-me'; 2 3const message = toast('Something'); 4// ... 5message.stopTimer(); 6// ... 7message.close();
Has static methods:
removeAll(position)
- Closes all toasts in that position. Accepts one argument
position
, default "top"
(described in options section)1import { ToastMeClass } from 'toast-me'; 2 3ToastMeClass.removeAll('bottom');
This method has separate simplified alias
1import { removeAllToasts } from 'toast-me'; 2removeAllToasts('bottom')
You will need node.js and preferred to have yarn to run the project.
Copy project to your local folder and then run in project's root folder next command to load dependencies:
yarn
When you load all dependencies, you able to run several commands:
yarn build
- produces production pack of library under the lib
folderyarn run-dev
- produces development version of your library, runs file watcher
and http server on http://localhost:3005yarn watch
- produces development version of your library, runs a file watcheryarn test
- runs the testsRoot folder
dev/
- Folder, containing development environment files. This folder is
server with webpack-dev-server
with yarn run-dev
command. toast-me.js
and toast-me.js.map
files inside are generated by webpack watcher from
/src
folder. You are able to change files in both folders and they are to
be reloaded in browser.lib/
- The place production pack will be located after build. Usually you won't
need it, until you wan't to compile library by yourself and insert in your
project manuallyscripts/
- Node.js executable scripts' folder, such as dev-server.js
or test.js
.
config/
- Configuration files' folder.src/
- Here is the code of library itself.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 2/19 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
63 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More