{"_id":"@arxdn/toast","_rev":"8-a73aafcc470bc8d932fbf587d2b81819","name":"@arxdn/toast","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@arxdn/toast","version":"1.0.0","_id":"@arxdn/toast@1.0.0","maintainers":[{"name":"arxdn","email":"armandorios.dev@gmail.com"}],"dist":{"shasum":"14cf6ccca0b50d1e6f5e7c1495d76b2e6a46836c","tarball":"https://registry.npmjs.org/@arxdn/toast/-/toast-1.0.0.tgz","fileCount":7,"integrity":"sha512-Bf3SM9IinTnLgjqnA4tUMw+bjBFdnlFWwmbsaUnbxG2xeHfjbbfOv6gkLQqG66mH+9hZni7ML0cpgDX3G+kihQ==","signatures":[{"sig":"MEQCIBIuyE9dFo9biBUUj34asUXwXRAjvRNAtd+EQCwy9VlmAiBlIlk/tqYVea94jBYxWaXNnUiinmBU4uF0EQjr5chIXQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":97971},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"ab4fad2a061e19dc2a6bbd51a7fa940d70ce891c","private":false,"scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","test:run":"vitest run","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arxdn","email":"armandorios.dev@gmail.com"},"_npmVersion":"11.6.2","directories":{},"_nodeVersion":"25.2.1","dependencies":{"@arxdn/shared":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.0","typescript":"^5.7.3","@types/node":"^22.10.6"},"_npmOperationalInternal":{"tmp":"tmp/toast_1.0.0_1769835494405_0.10329200385522097","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@arxdn/toast","version":"1.0.1","keywords":["toast","notification","javascript","typescript","ui"],"author":{"name":"Armando Rios"},"license":"MIT","_id":"@arxdn/toast@1.0.1","maintainers":[{"name":"arxdn","email":"armandorios.dev@gmail.com"}],"homepage":"https://github.com/arxdn/library-js#readme","bugs":{"url":"https://github.com/arxdn/library-js/issues"},"dist":{"shasum":"638a2c04ec4173529bc47075ccc7523f71ee8230","tarball":"https://registry.npmjs.org/@arxdn/toast/-/toast-1.0.1.tgz","fileCount":8,"integrity":"sha512-r4IOXxx3rayadw8XAsgSWDeSlE70WPsNccLpOO95Z0msc+Skeul9iKbFMGvIVmsmRE+j2kn8Kgpi14fXEZTkvw==","signatures":[{"sig":"MEQCIDto593RiT6jppYpt/gfTVXqHz3UcDoTcvjefJPdEpCFAiArgCFjvcnxyLS+9qG53GH0eCMVSlp4k83vycb51n6GfA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":99828},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"ab4fad2a061e19dc2a6bbd51a7fa940d70ce891c","private":false,"scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","test:run":"vitest run","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arxdn","email":"armandorios.dev@gmail.com"},"repository":{"url":"git+https://github.com/arxdn/library-js.git","type":"git","directory":"packages/toast"},"_npmVersion":"11.6.2","description":"Modern and customizable toast notification system","directories":{},"_nodeVersion":"25.2.1","dependencies":{"@arxdn/shared":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.0","typescript":"^5.7.3","@types/node":"^22.10.6"},"_npmOperationalInternal":{"tmp":"tmp/toast_1.0.1_1769837321842_0.5044970338830268","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@arxdn/toast","version":"1.0.3","keywords":["toast","notification","javascript","typescript","ui"],"author":{"name":"Armando Rios"},"license":"MIT","_id":"@arxdn/toast@1.0.3","maintainers":[{"name":"arxdn","email":"armandorios.dev@gmail.com"}],"homepage":"https://github.com/arxdn/library-js#readme","bugs":{"url":"https://github.com/arxdn/library-js/issues"},"dist":{"shasum":"23184838c53083b920eace21ae646de50b45506f","tarball":"https://registry.npmjs.org/@arxdn/toast/-/toast-1.0.3.tgz","fileCount":8,"integrity":"sha512-IBp8Lsdp+qFJOoS+McT7L9szjkWhhGcrxMWuQVAkwlQcsfEp7O9LCb03M5T7GbLpipOaqdPkQHsXMsH0huUYVg==","signatures":[{"sig":"MEQCIA5FUEbTwgeN9KlIPbKM6b1LTyCHSzc1X/4mcLILIxFTAiACnZHHmN45J0nOioHp67D0W/NgzbnYLSDEwUtO+0cAtg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":93254},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"c3d7eb0ddfd8935c5474179b2f87ef8c796ff547","private":false,"scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","test:run":"vitest run","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arxdn","email":"armandorios.dev@gmail.com"},"repository":{"url":"git+https://github.com/arxdn/library-js.git","type":"git","directory":"packages/toast"},"_npmVersion":"11.6.2","description":"Modern and customizable toast notification system","directories":{},"_nodeVersion":"25.2.1","dependencies":{"@arxdn/shared":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.0","typescript":"^5.7.3","@types/node":"^22.10.6"},"_npmOperationalInternal":{"tmp":"tmp/toast_1.0.3_1769852850424_0.6448743133120607","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@arxdn/toast","version":"1.1.0","keywords":["toast","notification","javascript","typescript","ui"],"author":{"name":"Armando Rios"},"license":"MIT","_id":"@arxdn/toast@1.1.0","maintainers":[{"name":"arxdn","email":"armandorios.dev@gmail.com"}],"homepage":"https://github.com/arxdn/library-js#readme","bugs":{"url":"https://github.com/arxdn/library-js/issues"},"dist":{"shasum":"fea11431d421c0f86f747b4eb1a28b6b854057e7","tarball":"https://registry.npmjs.org/@arxdn/toast/-/toast-1.1.0.tgz","fileCount":8,"integrity":"sha512-gSKG00IUuqdu7fv8ikibT1nuLUD7JCAvSqlREUm+0Twhq+uIpiGBJHUNGH3Si+53qW2gc7IVcaNyd4oS/mElaA==","signatures":[{"sig":"MEYCIQCKYsqdt4QC6DfOXjdWMHjdqC5Xyj1l+iqFKErz/UpHJgIhAJZqv+jiJ4gyGcS5g5I6MSRBP6hOqmC08lLZjUfu+7os","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arxdn%2ftoast@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":97566},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"f0c44bfdd13345d9f9c675776013af0b73df31ab","private":false,"scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","test:run":"vitest run","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arxdn","email":"armandorios.dev@gmail.com"},"repository":{"url":"git+https://github.com/arxdn/library-js.git","type":"git","directory":"packages/toast"},"_npmVersion":"10.9.4","description":"Modern and customizable toast notification system","directories":{},"_nodeVersion":"22.22.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.0","typescript":"^5.7.3","@types/node":"^22.10.6","@arxdn/shared":"*"},"_npmOperationalInternal":{"tmp":"tmp/toast_1.1.0_1771292688219_0.404375010639888","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@arxdn/toast","version":"1.1.1","keywords":["toast","notification","notifications","javascript","typescript","ui","browser","lightweight","zero-dependencies","accessible","a11y","tailwind","css"],"author":{"name":"Armando Rios"},"license":"MIT","_id":"@arxdn/toast@1.1.1","maintainers":[{"name":"arxdn","email":"armandorios.dev@gmail.com"}],"homepage":"https://arxdn.com/libraries/toast","bugs":{"url":"https://github.com/arxdn/library-js/issues"},"dist":{"shasum":"7cf25e1442546a2ad0e414d38b9bd1219394bba7","tarball":"https://registry.npmjs.org/@arxdn/toast/-/toast-1.1.1.tgz","fileCount":9,"integrity":"sha512-YNPCOEEIZkZ9xugIlUvfk2zLgk19C9kACL83OZTkBtj+JbeIZe+PmV2h21x3CWXIPsd7+2si0jo79EjkAXvlqQ==","signatures":[{"sig":"MEQCIG6Y3Pgapdrqn5QKSAJvGvEGwXxnjuMN6dPUd3DTKtafAiAXxXA8e3tIWTJYlBxvF2gMSfxCPG12b2IzEM5WCbjutQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arxdn%2ftoast@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":103991},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"7551fd7d7dd832eb831160266da681da12ece8c3","private":false,"scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","test:run":"vitest run","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arxdn","email":"armandorios.dev@gmail.com"},"repository":{"url":"git+https://github.com/arxdn/library-js.git","type":"git","directory":"packages/toast"},"_npmVersion":"10.9.4","description":"Modern and customizable toast notification system","directories":{},"_nodeVersion":"22.22.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.0","typescript":"^5.7.3","@types/node":"^22.10.6","@arxdn/shared":"*"},"_npmOperationalInternal":{"tmp":"tmp/toast_1.1.1_1771368542767_0.9007929286989818","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@arxdn/toast","version":"1.2.0","description":"Modern and customizable toast notification system","private":false,"author":{"name":"Armando Rios"},"license":"MIT","homepage":"https://arxdn.com/libraries/toast","repository":{"type":"git","url":"git+https://github.com/arxdn/library-js.git","directory":"packages/toast"},"bugs":{"url":"https://github.com/arxdn/library-js/issues"},"keywords":["toast","notification","notifications","javascript","typescript","ui","browser","lightweight","zero-dependencies","accessible","a11y","tailwind","css"],"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"publishConfig":{"access":"public","provenance":true},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","test":"vitest","test:run":"vitest run"},"devDependencies":{"@arxdn/shared":"*","@types/node":"^22.10.6","tsup":"^8.4.0","typescript":"^5.7.3","vitest":"^3.0.0"},"_id":"@arxdn/toast@1.2.0","gitHead":"8b2fbcf2dd375f0e179a0581655a693839f028f7","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-fTXiHlO1zOqve1iweZtSJLV0JAAPJtWMimBRbTxNbTgRC2Hke6CzTam5ZtIm3KZ0eufw8eCkBtQ0NzSfTRKx6Q==","shasum":"cb564e97efc079ae6bac5cbd38eab5cfe3e1f089","tarball":"https://registry.npmjs.org/@arxdn/toast/-/toast-1.2.0.tgz","fileCount":9,"unpackedSize":116303,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arxdn%2ftoast@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFn3FpxXywZIR0g83Pjf7snCArP48Q2eilKmp4flImjsAiEAl3tOjKzaaddDIUcubTU7cqgHmoEm3dG/3uSYnCb4eK4="}]},"_npmUser":{"name":"arxdn","email":"armandorios.dev@gmail.com"},"directories":{},"maintainers":[{"name":"arxdn","email":"armandorios.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/toast_1.2.0_1776758833268_0.15473997916107152"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-31T04:58:14.296Z","modified":"2026-04-21T08:07:13.681Z","1.0.0":"2026-01-31T04:58:14.554Z","1.0.1":"2026-01-31T05:28:41.991Z","1.0.2":"2026-01-31T09:27:07.629Z","1.0.3":"2026-01-31T09:47:30.567Z","1.1.0":"2026-02-17T01:44:48.377Z","1.1.1":"2026-02-17T22:49:02.919Z","1.2.0":"2026-04-21T08:07:13.399Z"},"bugs":{"url":"https://github.com/arxdn/library-js/issues"},"author":{"name":"Armando Rios"},"license":"MIT","homepage":"https://arxdn.com/libraries/toast","keywords":["toast","notification","notifications","javascript","typescript","ui","browser","lightweight","zero-dependencies","accessible","a11y","tailwind","css"],"repository":{"type":"git","url":"git+https://github.com/arxdn/library-js.git","directory":"packages/toast"},"description":"Modern and customizable toast notification system","maintainers":[{"name":"arxdn","email":"armandorios.dev@gmail.com"}],"readme":"# @arxdn/toast\n\nA modern, lightweight toast notification library for the browser. Zero dependencies, fully typed, and works with any framework or vanilla JS.\n\n**~4KB gzipped** | **Zero dependencies** | **TypeScript first** | **Accessible**\n\n[Documentation](https://arxdn.com/libraries/toast) | [GitHub](https://github.com/arxdn/library-js)\n\n## Features\n\n- **5 toast types** — success, error, warning, info, and default\n- **6 positions** — top-left, top-center, top-right, bottom-left, bottom-center, bottom-right\n- **Pause on hover** — auto-dismiss timer pauses when the user hovers over the toast\n- **Progress bar** — visual countdown indicator for auto-dismiss duration\n- **Animated** — smooth slide-in/slide-out transitions\n- **Accessible** — proper ARIA roles (`alert` for errors, `status` for others) and `aria-live` regions\n- **Custom icons** — use any HTML string (emoji, SVG, etc.) as the toast icon\n- **Custom CSS classes** — apply your own styles or Tailwind classes via the `className` option\n- **Dismiss callback** — run logic after a toast is dismissed via `onDismiss`\n- **Programmatic control** — create, update, dismiss, and query toasts at runtime\n- **Responsive** — full-width toasts on small screens, constrained on larger ones\n- **SSR safe** — guards against `window`/`document` access on the server\n\n## Installation\n\n```bash\nnpm install @arxdn/toast\n```\n\n```bash\npnpm add @arxdn/toast\n```\n\n```bash\nyarn add @arxdn/toast\n```\n\n## Quick Start\n\n```typescript\nimport { toast } from '@arxdn/toast'\n\ntoast.success('Operation successful')\ntoast.error('Something went wrong')\ntoast.warning('Check your input')\ntoast.info('New update available')\n```\n\n## Usage\n\n### With Options\n\n```typescript\ntoast.success('Saved!', {\n  duration: 5000,\n  position: 'bottom-right',\n  dismissible: false,\n})\n```\n\n### Custom Icon\n\n```typescript\ntoast.info('Uploading...', {\n  icon: '🚀',\n})\n\ntoast.success('Done', {\n  icon: '<svg>...</svg>',\n})\n```\n\n### Dismiss Callback\n\n```typescript\ntoast.error('Connection lost', {\n  onDismiss: instance => {\n    console.log(`Toast ${instance.id} was dismissed`)\n  },\n})\n```\n\n### Programmatic Control\n\n```typescript\n// Create and store the reference\nconst t = toast.success('Loading...')\n\n// Update the message\nt.update('Almost done...')\n\n// Dismiss it\nt.dismiss()\n\n// Or dismiss by ID\ntoast.dismiss(t.id)\n\n// Dismiss all toasts\ntoast.dismissAll()\n\n// Get all active toasts\nconst all = toast.getAll()\n```\n\n### Persistent Toast\n\n```typescript\n// Set duration to 0 to prevent auto-dismiss\ntoast.info('This stays until dismissed', {\n  duration: 0,\n})\n```\n\n### Custom Styling\n\nApply your own CSS classes to any toast:\n\n```typescript\ntoast.success('Styled!', {\n  className: 'my-custom-toast',\n})\n```\n\n```css\n.my-custom-toast {\n  background: linear-gradient(135deg, #667eea, #764ba2);\n  border-radius: 12px;\n  font-weight: bold;\n}\n```\n\n### With Tailwind CSS\n\nTailwind classes work directly via the `className` option:\n\n```typescript\ntoast.success('Tailwind toast', {\n  className: 'rounded-xl bg-gradient-to-r from-indigo-500 to-purple-600 font-bold',\n})\n```\n\nThe library uses `ui-toast-` prefixed CSS classes internally, so there are no conflicts with Tailwind or other CSS frameworks.\n\n## API\n\n### Methods\n\n| Method                                | Description                          |\n| ------------------------------------- | ------------------------------------ |\n| `toast.success(message, options?)`    | Create a success toast               |\n| `toast.error(message, options?)`      | Create an error toast                |\n| `toast.warning(message, options?)`    | Create a warning toast               |\n| `toast.info(message, options?)`       | Create an info toast                 |\n| `toast.default(message, options?)`    | Create a default toast               |\n| `toast.create(message, options?)`     | Create a toast with explicit options |\n| `toast.dismiss(id)`                   | Dismiss a toast by ID                |\n| `toast.dismissAll()`                  | Dismiss all active toasts            |\n| `toast.update(id, message, options?)` | Update an existing toast             |\n| `toast.getAll()`                      | Get all active toast instances       |\n\nAll create methods return a `ToastInstance` with `id`, `dismiss()`, and `update()`.\n\n### Options\n\n| Option         | Type                                                       | Default       | Description                                    |\n| -------------- | ---------------------------------------------------------- | ------------- | ---------------------------------------------- |\n| `type`         | `'success' \\| 'error' \\| 'warning' \\| 'info' \\| 'default'` | `'default'`   | Toast type (sets color and icon)               |\n| `position`     | `Position`                                                 | `'top-right'` | Screen position                                |\n| `duration`     | `number`                                                   | `3000`        | Auto-dismiss delay in ms (0 = no auto-dismiss) |\n| `dismissible`  | `boolean`                                                  | `true`        | Show close button                              |\n| `pauseOnHover` | `boolean`                                                  | `true`        | Pause auto-dismiss timer on hover              |\n| `className`    | `string`                                                   | `''`          | Custom CSS class(es) to add                    |\n| `icon`         | `string`                                                   | `''`          | Custom icon HTML (overrides default)           |\n| `onDismiss`    | `(instance: ToastInstance) => void`                        | `undefined`   | Callback fired after dismiss                   |\n\n### Positions\n\n```typescript\nimport { POSITIONS } from '@arxdn/toast'\n\ntoast.info('Hello', { position: POSITIONS.BOTTOM_CENTER })\n```\n\nAvailable: `top-left`, `top-center`, `top-right`, `bottom-left`, `bottom-center`, `bottom-right`\n\n### Advanced Usage\n\nYou can also import the class directly for more control:\n\n```typescript\nimport { ToastManager } from '@arxdn/toast'\n\nconst manager = new ToastManager()\nmanager.create('Hello', { type: 'success' })\n```\n\n## Types\n\nFull TypeScript definitions are included. Key types:\n\n```typescript\nimport type { ToastOptions, ToastInstance, Position, ToastType } from '@arxdn/toast'\n```\n\n## Browser Support\n\nWorks in all modern browsers (Chrome, Firefox, Safari, Edge). Requires `requestAnimationFrame` and `Map` support (available in all browsers since ~2015).\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}