Just the package
No framework runtime or peer dependency. Import the toast API and its stylesheet, then mount one renderer.
Toast notifications for the moments that matter.
Confirm a save, follow a promise, or offer a way back.
npm install @samline/notifyZero runtime dependenciesJavaScript & TypeScriptMIT licensed
Every kind of feedback
One call. The right tone.
Pick a type to send a real notification. Change the position or the options, then hover the stack to expand it.
Each button calls the same toast API you install. Options update the mounted toaster in place; hover or focus pauses timers and swipe dismisses.
Profile settings
A little more like you.Update your public display name. Nothing leaves this page.
Your profile is up to date.
A loading notification becomes a success on the same id. The saved name stays visible in the form.
Report delivery
Your report, ready to send.Send the October report. The first simulated request fails; retrying succeeds.
October report · Not sent
An error stays available with a real Retry action. Retry changes the local delivery receipt.
Release desk
A release ready for review.Open a release card, write a note inside the notification and save it back to the page. Your integration owns the DOM and appearance.
The release notes are ready for your review.
Runtime fixes · Compatible API · Native DOMRelease 4.0.0 · Ready for review
toast.custom uses safe DOM construction. Your integration supplies the custom appearance and close action.
One small package. Right at home in your stack.
No framework runtime or peer dependency. Import the toast API and its stylesheet, then mount one renderer.
Polite live updates, keyboard controls and focus-paused timers. Your app chooses readable content, contrast and enough time to act.
Create one toaster at your client root. Keep its controller to update preferences, and destroy it when the integration leaves.
Use ESM or CommonJS in your build, or a standalone browser script. The stylesheet is a separate asset in either setup.
Use the ordinary DOM API from React, Vue, Svelte, Astro or a CMS. No framework-specific component or adapter is required.
Follow cancelable work, chain review and decision actions, keep a live activity stack, or build an editable card with your own DOM.
Choose package imports or a plain script tag. The module registry is optional; types and styles are supporting resources.
Package / ESM + CommonJS
The toast factory, singleton lifecycle, types and advanced exports. Module imports do not install a global or mount a renderer.
Optional module registry
The same singleton toast and toaster helpers collected in one object. This import does not create window.Notify.
HTML / CDN
Load the standalone script and stylesheet. The script mounts a default toaster when the body is ready.
Styles
The required layout, stack, color and reduced-motion styles. Import once, then add your own CSS after the package stylesheet.
Install the package or load the CDN assets. Choose the matching initializer after the body is ready. Load main.js as a module for ESM, or with defer after the deferred CDN script.
Read the installation guideLoad Notify
npm install @samline/notifypnpm add @samline/notifyyarn add @samline/notifybun add @samline/notify<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@samline/notify@5.0.1/dist/style.css">
<script src="https://cdn.jsdelivr.net/npm/@samline/notify@5.0.1/dist/browser/notify.global.js" defer></script>Add a trigger
Use a native button. Notify creates the notification markup for you.
<button id="save" type="button">Save changes</button>Mount and notify
import { createToaster, toast } from '@samline/notify'
import '@samline/notify/style.css'
const toaster = createToaster({ richColors: true })
document.querySelector('#save').addEventListener('click', () => {
toast.success('Changes saved')
})// Load the CDN stylesheet and script first.
const notify = window.Notify
const toaster = notify.createToaster({ richColors: true })
document.querySelector('#save').addEventListener('click', () => {
notify.toast.success('Changes saved')
})Mount once near the client root. The examples below continue with this toaster; complete standalone files are available in the guide.
Explore the configuration referenceContinue from the instance above. Use the same toast id for progress, update the existing controller, and clean up when the application tears down.
Keep the id returned by a loading toast. Replace its message and type when the task completes; loading itself has no automatic timeout.
Read the toast APIconst id = toast.loading('Preparing your report…')
// When your application finishes the work:
toast.success('Your report is ready', { id })Update the existing toaster when your theme or layout changes. Omitted options keep their current values.
Read the configuration referencetoaster.update({
theme: 'dark',
position: 'top-right',
closeButton: true,
})At application teardown, destroy the singleton and publish its dismissals. Mount again explicitly if the integration returns.
Understand cleanup and remountingimport { destroyToaster } from '@samline/notify'
// In your application or component cleanup:
destroyToaster()Try an interaction, then bring it into your application.
Installation, practical guides and the complete API for Notify.
Read the documentation