Installations
npm install @nagnu/sweetalert2-react-content
Developer Guide
Typescript
Yes
Module System
CommonJS, UMD
Node Version
18.17.1
NPM Version
9.6.7
Score
68.9
Supply Chain
78.7
Quality
75.1
Maintenance
50
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (93.9%)
TypeScript (3.34%)
HTML (1.7%)
CSS (1.07%)
Developer
sweetalert2
Download Statistics
Total Downloads
462
Last Day
3
Last Week
5
Last Month
18
Last Year
102
GitHub Statistics
707 Stars
294 Commits
51 Forks
15 Watching
3 Branches
7 Contributors
Bundle Size
2.46 kB
Minified
1.13 kB
Minified + Gzipped
Package Meta Information
Latest Version
5.0.9
Package Id
@nagnu/sweetalert2-react-content@5.0.9
Unpacked Size
96.48 kB
Size
14.07 kB
File Count
19
NPM Version
9.6.7
Node Version
18.17.1
Publised On
05 Nov 2023
Total Downloads
Cumulative downloads
Total Downloads
462
Last day
-25%
3
Compared to previous day
Last week
-16.7%
5
Compared to previous week
Last month
500%
18
Compared to previous month
Last year
-53.4%
102
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
3
Dev Dependencies
25
sweetalert2-react-content
Official SweetAlert2 enhancer adding support for React elements as content.
The following options can be React elements:
- title
- html
- confirmButtonText
- denyButtonText
- cancelButtonText
- footer
- closeButtonHtml
- iconHtml
- loaderHtml
Installation
1npm install --save sweetalert2 sweetalert2-react-content
Usage Example
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.
Limitations
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
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
6 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 5
Reason
5 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-457r-cqc8-9vj9
- Warn: Project is vulnerable to: GHSA-8jh9-wqpf-q52c
- Warn: Project is vulnerable to: GHSA-mrr8-v49w-3333
- Warn: Project is vulnerable to: GHSA-pg98-6v7f-2xfv
- Warn: Project is vulnerable to: GHSA-qq6h-5g6j-q3cm
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/sweetalert2/sweetalert2-react-content/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/sweetalert2/sweetalert2-react-content/ci.yml/main?enable=pin
- Info: 0 out of 1 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 13 are checked with a SAST tool
Score
3.4
/10
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