Gathering detailed insights and metrics for wc-toast-idplans
Gathering detailed insights and metrics for wc-toast-idplans
Gathering detailed insights and metrics for wc-toast-idplans
Gathering detailed insights and metrics for wc-toast-idplans
Add notifications component to your javascript projects easily using wc-toast.
npm install wc-toast-idplans
Typescript
Module System
Node Version
NPM Version
74.1
Supply Chain
99.4
Quality
75.3
Maintenance
100
Vulnerability
100
License
JavaScript (81.35%)
HTML (15.06%)
CSS (3.6%)
Total Downloads
422
Last Day
2
Last Week
3
Last Month
16
Last Year
89
MIT License
162 Stars
99 Commits
12 Forks
4 Watchers
1 Branches
4 Contributors
Updated on Jun 13, 2025
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
wc-toast-idplans@1.0.1
Unpacked Size
45.58 kB
Size
10.24 kB
File Count
19
NPM Version
6.14.13
Node Version
14.17.0
Cumulative downloads
Total Downloads
Add notifications component easily using wc-toast. Vanilla JavaScript web component notification inspired by react-hot-toast
Add from NPM
npm i wc-toast
or import from CDN
import { toast } from 'https://cdn.skypack.dev/wc-toast';
or just try it on https://abdmmar.github.io/wc-toast
Make sure you've add wc-toast
to your app through NPM or CDN. See Installation for more details.
Add wc-toast
to your app and placed it at the top.
<body>
<wc-toast></wc-toast>
<button class="toast"></button>
</body>
Start toasting! Call it from anywhere in your app.
import { toast } from 'wc-toast'
// or if you use CDN:
// import { toast } from 'https://cdn.skypack.dev/wc-toast';
document.querySelector('.toast').addEventListener('click', () => {
toast('Hello world!');
});
You can customize style of wc-toast-item through custom properties
--wc-toast-background: #fff;
--wc-toast-max-width: 350px;
--wc-toast-stroke: #2a2a32;
--wc-toast-color: #000;
--wc-toast-font-family: 'Roboto', sans-serif;
--wc-toast-font-size: 16px;
--wc-toast-border-radius: 8px;
--wc-toast-content-margin: 4px 10px;
toast(
message: string,
options: {
icon: {
type: 'success' | 'loading' | 'error' | 'custom' | 'svg';
content: string;
};
duration: number | 4000;
theme: {
type: 'light' | 'dark' | 'custom';
style: {
background: string;
color: string;
stroke: string;
};
};
})
<wc-toast position="top-left | top-right | top-center | bottom-left | bottom-right | bottom-center">
<slot></slot>
</wc-toast>
<wc-toast-item
type="success | loading | error | blank | custom"
theme="light | dark | custom"
duration="number | 3500 | 6000000">
<slot></slot>
</wc-toast-item>
<wc-toast-icon icon="string" type="success | loading | error | blank | custom">
<slot name="svg"></slot>
</wc-toast-icon>
<wc-toast-content message="string">
<slot name="message"></slot>
<slot name="content"></slot>
</wc-toast-content>
<wc-toast-close-button></wc-toast-close-button>
See CONTRIBUTING.md
Thanks to react-hot-toast for an amazing library and such an inspiration. If you build a React project and need notifications, you should check out this library.
No vulnerabilities found.
No security vulnerabilities found.
Last Day
0%
2
Compared to previous day
Last Week
-40%
3
Compared to previous week
Last Month
-5.9%
16
Compared to previous month
Last Year
39.1%
89
Compared to previous year