{"id":43873707,"url":"https://github.com/huanfe1/sonner-js","last_synced_at":"2026-02-06T14:38:17.331Z","repository":{"id":282204460,"uuid":"947673588","full_name":"huanfe1/sonner-js","owner":"huanfe1","description":"An opinionated toast component for Pure JS.","archived":false,"fork":false,"pushed_at":"2025-11-29T12:26:27.000Z","size":357,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-01T14:00:38.393Z","etag":null,"topics":["pure-javascript","sonner","toast"],"latest_commit_sha":null,"homepage":"https://sonner-js.huanfe1.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huanfe1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-13T04:11:54.000Z","updated_at":"2025-11-29T12:26:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"c465a22d-6209-41b0-b699-71ef12d07020","html_url":"https://github.com/huanfe1/sonner-js","commit_stats":null,"previous_names":["huanfe1/sonner-js"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/huanfe1/sonner-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanfe1%2Fsonner-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanfe1%2Fsonner-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanfe1%2Fsonner-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanfe1%2Fsonner-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huanfe1","download_url":"https://codeload.github.com/huanfe1/sonner-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanfe1%2Fsonner-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29164921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T14:37:12.680Z","status":"ssl_error","status_checked_at":"2026-02-06T14:36:22.973Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pure-javascript","sonner","toast"],"created_at":"2026-02-06T14:38:16.531Z","updated_at":"2026-02-06T14:38:17.320Z","avatar_url":"https://github.com/huanfe1.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e🍞 Sonner for Pure JS\u003c/h1\u003e\n  \u003cp\u003eAn elegant toast component designed for Pure JavaScript\u003c/p\u003e\n\n  [![npm version](https://img.shields.io/npm/v/sonner-js.svg?style=flat-square)](https://www.npmjs.com/package/sonner-js)\n  [![npm downloads](https://img.shields.io/npm/dm/sonner-js.svg?style=flat-square)](https://www.npmjs.com/package/sonner-js)\n  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n\n  \u003cp\u003e\u003cem\u003eBuilt on \u003ca href=\"https://sonner.emilkowal.ski/\"\u003eSonner\u003c/a\u003e, optimized for pure JavaScript environments\u003c/em\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n## ✨ Features\n\n- 🚀 **Zero Dependencies** - Pure JavaScript implementation, no frameworks required\n- 📱 **Responsive Design** - Perfect adaptation for mobile and desktop\n- 🎨 **Multiple Styles** - Support for success, error, warning, info and more types\n- ⚡ **Lightweight** - Small bundle size with excellent performance\n- 🔧 **Highly Customizable** - Rich configuration options\n- 🌙 **Theme Support** - Built-in light and dark themes\n- 📦 **Multi-format Support** - UMD, ESM, CommonJS formats\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\nnpm install sonner-js\n```\n\n### Basic Usage\n\n```javascript\nimport toast from 'sonner-js';\n\n// Simple toast\ntoast('Hello World!');\n\n// Toast with description\ntoast('Operation successful', {\n    description: 'Your data has been saved'\n});\n```\n\n## 📖 Usage Guide\n\n### Different Toast Types\n\n```javascript\n// Success toast\ntoast.success('Operation successful');\n\n// Error toast\ntoast.error('Operation failed');\n\n// Info toast\ntoast.info('This is an information');\n\n// Warning toast\ntoast.warning('Please note');\n```\n\n### Toast with Action Buttons\n\n```javascript\ntoast('Confirm action', {\n    action: {\n        label: 'Confirm',\n        onClick: () =\u003e console.log('User clicked confirm')\n    }\n});\n\n// With cancel button\ntoast('Confirm deletion', {\n    action: {\n        label: 'Cancel',\n        onClick: () =\u003e console.log('User cancelled operation'),\n        cancel: true\n    }\n});\n```\n\n### Promise Handling\n\n```javascript\nconst fetchData = () =\u003e fetch('/api/data');\n\ntoast.promise(fetchData, {\n    loading: 'Loading...',\n    success: 'Data loaded successfully',\n    error: 'Failed to load data'\n});\n```\n\n### Update and Dismiss Toasts\n\n```javascript\n// Create toast and get ID\nconst toastId = toast('Processing...');\n\n// Update toast\ntoast.success('Processing complete', { id: toastId });\n\n// Dismiss specific toast\ntoast.dismiss(toastId);\n\n// Dismiss all toasts\ntoast.dismiss();\n```\n\n### Permanent Toasts\n\n```javascript\ntoast('Important notice', {\n    duration: 0  // Set to 0 for permanent display\n});\n```\n\n## 🌐 CDN Usage\n\n### UMD Format\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/sonner-js/dist/umd/index.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    sonnerJS('Hello from CDN!');\n\u003c/script\u003e\n```\n\n### ESM Format\n\n```html\n\u003cscript type=\"module\"\u003e\n    import toast from 'https://cdn.jsdelivr.net/npm/sonner-js/+esm';\n    toast('Hello from ESM!');\n\u003c/script\u003e\n```\n\n## ⚙️ Configuration Options\n\n```javascript\nimport toast from 'sonner-js';\n\n// Global configuration\ntoast.config({\n    theme: 'dark',           // 'light' | 'dark'\n    position: 'top-right',   // Position\n    duration: 4000,         // Duration in milliseconds\n    closeButton: true,      // Show close button\n    richColors: true,        // Rich colors\n    expand: true,           // Expand animation\n    visibleToasts: 3,       // Number of visible toasts\n    gap: 8,                 // Toast spacing\n    offset: 16,             // Margin\n    mobileOffset: 16,       // Mobile margin\n    dir: 'ltr'              // Text direction\n});\n```\n\n## 📄 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuanfe1%2Fsonner-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuanfe1%2Fsonner-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuanfe1%2Fsonner-js/lists"}