
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
toastifier
Advanced tools
$ npm install --save toastifier
$ yarn add toastifier
import React from "react";
import toastifier from "toastifier";
import "toastifier/dist/toastifier.min.css";
function App() {
return (
<div>
<button onClick={() => toastifier("Alert Check")}>Notify!</button>
</div>
);
}
Check this to get you started!
Name | Type | Description |
---|---|---|
type | String | Toast Type |
animation | String | Animation Category |
duration | Number | Duration for Animation . |
position | String | Toast position on window. |
onhoverPause | Boolean | pasue toast on hover. |
showIcon | Boolean | Show default SVG icons on toast |
onClick | Function | Function to trriger events. |
styleClass | Class Object | Object for Style Class. |
background | String | Background colour, by default white |
text | String | Text Color, by default based on toast type |
border | String | Border, by default based on toast type |
onAppear | Function | Callback executes when toast appears |
onDisappear | Function | Callback executes when toast disappears |
Name | Values | Default |
---|---|---|
type | error, success, warn, info | success |
animation | flip, bounce, fade, zoom | bounce |
position | top-left, top-center, top-right, bottom-left, bottom-center, bottom-right, | top-center |
onhoverPause | true/false | false |
showIcon | true/false | true |
import React from "react";
import toastifier from "toastifier";
import "toastifier/dist/toastifier.min.css";
function App() {
const toastfunction = () => {
alert("function Trigerred");
};
const options = {
type: "success",
shadow: false,
animation: "bounce",
duration: 3000,
position: "top-center",
onhoverPause: true,
onClick: toastfunction,
styleClass: {
background: "#22272e", // dark mode
text: "#fff",
border: "#eee",
},
onAppear: () => console.log('toast appeared'),
onDisappear: () => console.log('toast disappeared')
};
const notify = () => toastifier("Boom! it Worked", options);
return (
<div>
<button onClick={notify}>Notify!</button>
</div>
);
}
Show your ❤️ and support by giving a ⭐. Any suggestions are welcome!
This project exists thanks to all the people who contribute.
FAQs
Light and Simple Multi-Framework Toaster
We found that toastifier demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.