Elestia Open Source Ratings
6.6

SweetAlert2

Reasonable, with limits. 4th of 8 toasts and alerts.

SweetAlert2 is a library for alert, confirm and prompt dialogs. It has a toast mode, works with any framework or none, and has no dependencies. It is polished and actively fixed, but it is mainly a dialog tool, and versions 11.6.1 to 11.22.3 contained a payload that froze some Russian-language sites. Pick it for promise-based confirm dialogs on any stack. For toasts in React apps, prefer Sonner or React-Toastify.

Best for: Projects on any stack, including plain JS, jQuery, Laravel and Vue, that need ready-made, accessible confirm and prompt dialogs with a promise-based result.

WebsiteGitHubnpm

Scores

Overall6.6

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 6.0, likely 5.0 to 7.0

It is a capable, well-maintained dialog library that suits confirm and prompt needs on any stack. For toasts, and in React apps, Sonner and React-Toastify fit better and are growing faster. The site-disabling code in versions 11.6.1 to 11.22.3 and its weak Scorecard add trust risk, so pin 11.22.4 or later if you use it.

GPT-6.2 Sol: 7.1, likely 6.0 to 8.2

SweetAlert2 is a strong choice for new browser apps that need confirmations and prompts across frameworks. Sonner is a better fit for React apps that mainly need stacked toasts. The six-month release gap, weak publishing safeguards, and download growth below the catalog baseline keep SweetAlert2 from being a category-wide default.

  • sweetalert2.github.io: Shows a broad dialog API and a basic toast mode.
  • sonner.emilkowal.ski/toaster: Shows dedicated stacking and visibility controls for React notifications.
  • github.com/sweetalert2/sweetalert2/releases: The latest stable release is 11.26.25 from May 2026.
  • scorecard score and checks: Checks flag weak review, branch protection, and dependency pinning.
  • npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo, and medianDownloadsRatio: The package grew in absolute downloads while losing ground against the catalog baseline.
Needed by many6.5

How many developers need a tool for this job?

Claude Opus 5.5: 6.0, likely 5.0 to 7.0

Most web apps need confirm dialogs or short messages, and SweetAlert2 works with any framework or none. It focuses on modal alerts rather than toasts, so it covers one half of the category's job best.

GPT-6.2 Sol: 7.0, likely 5.9 to 8.0

Many web apps need status messages, confirmations, or prompts, and SweetAlert2 works across browser frameworks. Its appeal is narrower for teams that already get dialogs and toasts from a component library. The developer survey shows a range of frontend stacks but does not measure demand for a separate alert library.

Helps a lot7.3

How well does it do the job for those who need it?

Claude Opus 5.5: 7.0, likely 6.0 to 8.0

For dialogs it is rich and polished: custom buttons, inputs, validation, async confirmation, WAI-ARIA focus handling and strict TypeScript types. It sits outside React's model, its package is large, and its toast mode is less refined than dedicated toast libraries.

GPT-6.2 Sol: 7.6, likely 6.5 to 8.7

Version 11.26.25 handles dialog inputs, asynchronous confirmation, and keyboard focus through a typed API with runnable examples. The current implementation replaces an active popup when a new one opens, a limitation users have reported and one Sonner avoids with toast stacking. Independent performance and coding-agent evaluations of the current release are sparse.

Holds up over time6.9

Will it still be a good choice in two years?

Claude Opus 5.5: 7.0, likely 5.5 to 8.0

It is active, with 110 commits and 17 releases in the last year, few open issues, and a stable v11 line with no breaking changes. The work rests mainly on one sponsored maintainer, code review is not enforced, and the last release was in May 2026.

  • github commitsLastYear / releasesLastYear: 110 commits, 17 releases
  • github openIssues: 4 open issues, 0 open PRs
  • scorecard Code-Review: 0: changes are merged without review
  • github.com/sweetalert2/sweetalert2/releases: Patch releases only; no v12 breaking changes

GPT-6.2 Sol: 6.8, likely 5.6 to 7.9

SweetAlert2 recorded 110 commits and 17 releases in the past year, and maintainers shipped a workaround within days of a user reporting an iOS scrolling bug. Repository activity continued into November, but the latest package release was in May. Public sponsorship centers on the lead maintainer, and the depth of funding and backup release access are unclear.

Used widely6.0

How many use it, and is that growing?

Claude Opus 5.5: 6.0, likely 5.0 to 7.0

It has about 4.8M downloads per 4 weeks and 76.8k dependent repositories, second only to React-Toastify by dependents. CDN use does not show up in downloads. Growth of 1.6x a year is far below the 4.1x median, so it is losing ground to Sonner and the React toast libraries.

  • npm downloadsLast4Weeks: 4.85M vs 3.03M a year ago (1.6x)
  • medianDownloadsRatio: Median is 4.1x, so it is losing share
  • dependents repos: 76,801 repos, 1,129 packages
  • github stars: 18.1k stars, the most in the category

GPT-6.2 Sol: 5.9, likely 4.8 to 7.1

The collector found about 76,800 dependent repositories, behind React-Toastify and ahead of react-hot-toast. Four-week npm downloads grew from 3.03 million to 4.85 million, a 1.60× increase that trails every listed peer and the catalog’s 4.1× baseline. Automated installs and CDN loading make downloads a weak measure of how many projects choose it today.

  • dependents repos and packages: 76,801 repositories and 1,129 packages in the collector’s partial index.
  • npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo, and medianDownloadsRatio: 1.60× year-over-year download growth against a 4.1× baseline.
  • peers: React-Toastify has 97,433 indexed repositories and react-hot-toast has 41,688.
  • jsdelivr.com/package/npm/sweetalert2: Browser apps can load SweetAlert2 directly from a CDN.
Vouched for5.2

Who stands behind it being good?

Claude Opus 5.5: 5.0, likely 4.0 to 6.5

It has long and wide use in tutorials, Laravel and PHP stacks and admin templates, and it appears in independent roundups. No current survey covers it, no prominent framework builds on it, and it drew little discussion on Hacker News or Bluesky in 2025–2026.

GPT-6.2 Sol: 5.3, likely 3.9 to 6.6

Livewire Alert builds its dialog and toast API on SweetAlert2 and shipped a release in 2026. A Svelte user report praises its simplicity, and REDCap documented shipping it for custom dialogs in 2020. Recent evidence from large production deployments and project-specific satisfaction surveys is sparse.

Safe5.4

How safe is it to depend on?

Claude Opus 5.5: 5.0, likely 3.5 to 6.5

It has zero dependencies, an MIT licence and no advisories in the last 24 months. However, versions 11.6.1 to 11.22.3 hold code that disables pages on some Russian-language sites. The payload was backported to the 8.x–10.x lines, and was removed only in 11.22.4 (August 2025). The OpenSSF Scorecard is 3.6, with no branch protection, code review or signed releases.

GPT-6.2 Sol: 5.8, likely 4.6 to 7.0

The MIT license and zero runtime dependencies keep the install footprint small. Version 11.22.4 removed unrelated media playback on certain domains more than two years after the 2023 advisory, and the current release includes that fix. Releases are automated through a workflow configured for npm trusted publishing, but the 3.6 OpenSSF score reflects weak review, branch protection, and dependency pinning checks. The number of people who can authorize releases is unclear.

Good

  • Its promise-based API reports isConfirmed, isDenied or isDismissed, with built-in input validation and an async preConfirm hook.
  • It has zero dependencies and bundled TypeScript types (strict mode since late 2025), and it works without any framework.
  • Maintenance is very responsive: 4 open issues and steady patch releases for focus, accessibility and browser quirks.
  • It has a large installed base (about 77k dependent repositories) and a familiar, well-documented API that AI agents write correctly.

Bad

  • Versions 11.6.1 to 11.22.3 (2022–2025) held code that disabled pages and played audio on some Russian-language sites, and users made forks to remove it.
  • It is imperative and sits outside React's component model, so rendering custom React content needs extra integration work.
  • It is heavier than toast-focused peers, and its toasts are a side feature compared with Sonner or React-Toastify.
  • Downloads grew 1.6x in a year, well below the 4.1x median, so its share of new projects is shrinking.

The numbers

npm downloads, 4 weeks
4.8M +60% in a year
GitHub stars
18k
Commits, 12 months
110
npm version
11.26.25 May 2026
Versions, 12 months
17
Advisories, 24 months
0 of 5 ever
OpenSSF Scorecard
3.6 out of 10, Nov 2026
Licence
MIT

Read on 21 November 2026 from GitHub (sweetalert2/sweetalert2), npm (sweetalert2), OSV and the OpenSSF Scorecard.

Toasts and alerts

  1. 7.7Sonner
  2. 7.2React-Toastify
  3. 6.7react-hot-toast
  4. 6.6SweetAlert2
  5. 6.2Vue Sonner
  6. 4.6notistack
  7. 4.5Toastify JS
  8. 4.0Notyf
Compare all 8 on six scores