Gathering detailed insights and metrics for sweetalert2-react-content
Gathering detailed insights and metrics for sweetalert2-react-content
Gathering detailed insights and metrics for sweetalert2-react-content
Gathering detailed insights and metrics for sweetalert2-react-content
npm install sweetalert2-react-content
Typescript
Module System
Node Version
NPM Version
JavaScript (93.9%)
TypeScript (3.34%)
HTML (1.7%)
CSS (1.07%)
Total Downloads
9,480,044
Last Day
8,469
Last Week
40,850
Last Month
207,136
Last Year
2,667,879
707 Stars
294 Commits
51 Forks
15 Watching
3 Branches
7 Contributors
Minified
Minified + Gzipped
Latest Version
5.1.0
Package Id
sweetalert2-react-content@5.1.0
Unpacked Size
71.68 kB
Size
10.24 kB
File Count
18
NPM Version
10.8.2
Node Version
20.18.0
Publised On
16 Dec 2024
Cumulative downloads
Total Downloads
Last day
-19.7%
8,469
Compared to previous day
Last week
-21.6%
40,850
Compared to previous week
Last month
3.8%
207,136
Compared to previous month
Last year
3.7%
2,667,879
Compared to previous year
3
24
Official SweetAlert2 enhancer adding support for React elements as content.
The following options can be React elements:
1npm install --save sweetalert2 sweetalert2-react-content
1import Swal from 'sweetalert2' 2import withReactContent from 'sweetalert2-react-content' 3 4const MySwal = withReactContent(Swal) 5 6MySwal.fire({ 7 title: <p>Hello World</p>, 8 didOpen: () => { 9 // `MySwal` is a subclass of `Swal` with all the same instance & static methods 10 MySwal.showLoading() 11 }, 12}).then(() => { 13 return MySwal.fire(<p>Shorthand works too</p>) 14})
The dist/sweetalert2-react-content.umd.js
file defines window.sweetalert2ReactContent
in non-CJS/AMD environments.
SweetAlert2 renders its content outside of the ReactTree
. In order to render React Router components (such as Link
) you have to wrap them in the routing context which should be the same with the app.
That can be achived by using the HistoryRouter
with shared history
. Please refer to the official code example ↗️
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
6 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 5
Reason
5 existing vulnerabilities detected
Details
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More