
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A lightweight, customizable toast notification library for both vanilla JavaScript and React applications
A lightweight, customizable toast notification library for both vanilla JavaScript and React applications.
npm install toaster
import { toast } from "toaster";
// Basic usage
toast.success("Operation completed successfully!");
toast.error("Something went wrong!");
toast.info("Here is some information");
toast.warning("Please be careful");
// Custom toast
toast.show("Custom message", {
backgroundColor: "#6366f1",
duration: 5000,
position: "bottom-center",
});
// Clear all toasts
toast.clearAll();
import React from "react";
import { ToastProvider, useToast } from "toaster/react";
function App() {
return (
<ToastProvider>
<MyComponent />
</ToastProvider>
);
}
function MyComponent() {
const toast = useToast();
const handleSuccess = () => {
toast.success("Operation completed!");
};
const handleError = () => {
toast.error("Something went wrong!");
};
return (
<div>
<button onClick={handleSuccess}>Show Success</button>
<button onClick={handleError}>Show Error</button>
</div>
);
}
toast.success(message, options?)Shows a success toast notification.
toast.error(message, options?)Shows an error toast notification.
toast.info(message, options?)Shows an info toast notification.
toast.warning(message, options?)Shows a warning toast notification.
toast.show(message, options?)Shows a custom toast notification.
toast.clearAll()Removes all active toast notifications.
toast.setDefaultOptions(options)Sets default options for all future toasts.
ToastProviderReact context provider that wraps your app.
Props:
children - React childrenconfig - Configuration object (optional)useToast()React hook that returns toast methods.
Returns:
success(message, options?) - Show success toasterror(message, options?) - Show error toastinfo(message, options?) - Show info toastwarning(message, options?) - Show warning toastshow(message, options?) - Show custom toastclearAll() - Clear all toastsremoveToast(id) - Remove specific toastinterface ToastOptions {
duration?: number; // Duration in milliseconds (default: 3000)
position?: ToastPosition; // Position on screen (default: 'top-right')
icon?: string | HTMLElement; // Custom icon
backgroundColor?: string; // Custom background color
textColor?: string; // Custom text color
className?: string; // Additional CSS classes
style?: Partial<CSSStyleDeclaration>; // Custom CSS styles
onClick?: () => void; // Click callback
onClose?: () => void; // Close callback
}
'top-left''top-right' (default)'top-center''bottom-left''bottom-right''bottom-center''success' - Green background'error' - Red background'info' - Blue background'warning' - Orange background'custom' - Custom styling<ToastProvider
config={{
defaultDuration: 5000,
defaultPosition: "bottom-center",
maxWidth: "500px",
minWidth: "350px",
spacing: "12px",
borderRadius: "12px",
fontSize: "16px",
fontFamily: "Arial, sans-serif",
zIndex: 9999,
customVariables: {
"--toast-success-bg": "#059669",
"--toast-error-bg": "#dc2626",
},
}}
>
<App />
</ToastProvider>
The library uses CSS custom properties for easy styling:
:root {
--toast-success-bg: #10b981;
--toast-error-bg: #ef4444;
--toast-info-bg: #3b82f6;
--toast-warning-bg: #f59e0b;
--toast-text-color: #ffffff;
--toast-border-radius: 8px;
--toast-padding: 12px 16px;
--toast-font-size: 14px;
--toast-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif;
--toast-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
--toast-z-index: 10000;
--toast-spacing: 8px;
--toast-max-width: 400px;
--toast-min-width: 300px;
}
MIT
FAQs
A lightweight, customizable toast notification library for both vanilla JavaScript and React applications
We found that toasteer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.