toast-anchor
v1.0.9
Published
A lightweight, zero-dependency toast, anchored tooltip, and modal library.
Maintainers
Readme
_____ _ _ _
|_ _|__ __ _ ___| |_ / \ _ __ ___| |__ ___ _ __
| |/ _ \/ _` |/ __| __| / _ \ | '_ \ / __| '_ \ / _ \| '__|
| | (_) | (_| \__ \ |_ / ___ \| | | | (__| | | | (_) | |
|_|\___/ \__,_|___/\__| /_/ \_\_| |_|\___|_| |_|\___/|_| A zero-dependency, fully customizable toast & modal notification library. Works with Vanilla JS and React. No setup. No stylesheet imports. No fluff.
Install
npm install toast-anchor
# or
pnpm add toast-anchor
# or
yarn add toast-anchorQuick Start
// Vanilla JS
import toast from 'toast-anchor';
toast.success('Saved!');
toast.error('Something went wrong.');
toast.warning('Low storage.');
toast.info('New version available.');// React
import { useToast } from 'toast-anchor';
function App() {
const toast = useToast();
return <button onClick={() => toast.success('Done!')}>Save</button>;
}Package Structure
toast-anchor/
└── src/
├── index.js # Entry — re-exports + default toast object
├── defaults.js # DEFAULTS + configure()
├── core-toast.js # createToast, dismissToast, dismissAll
├── promise-toast.js # promiseToast
├── anchored-toast.js # anchoredToast + shared geometry helpers
├── anchored-confirm.js # anchoredConfirm
├── modal.js # modalConfirm
├── react.js # useToast hook
├── icons.js # ICONS + spinner keyframe
└── audio.js # playSound (lazy AudioContext)MIT License · Built with zero dependencies · Made for developers who care about details
