Gathering detailed insights and metrics for sweetalert2-react
Gathering detailed insights and metrics for sweetalert2-react
Gathering detailed insights and metrics for sweetalert2-react
Gathering detailed insights and metrics for sweetalert2-react
sweetalert2-react-content
Official sweetalert2 enhancer adding support for React elements as content.
react-sweetalert2
A sweetalert2 wrapper to ReactJS
omerman-sweetalert2-react-content
Official sweetalert2 enhancer adding support for React elements as content.
react-sweetalert2-redux
This is an implementation of react-sweetalert2 with redux and redux-thunk
npm install sweetalert2-react
Typescript
Module System
Min. Node Version
Node Version
NPM Version
CSS (53.21%)
JavaScript (46.79%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
45 Stars
143 Commits
31 Forks
3 Watchers
13 Branches
1 Contributors
Updated on Jul 11, 2024
Latest Version
0.8.3
Package Id
sweetalert2-react@0.8.3
Unpacked Size
287.20 kB
Size
69.71 kB
File Count
6
NPM Version
6.10.2
Node Version
10.16.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
21
Declarative SweetAlert in React
This is a React SweetAlert wrapper for https://github.com/limonte/sweetalert2
$ npm install sweetalert2-react
1import React, { Component } from 'react'; 2import SweetAlert from 'sweetalert2-react'; 3 4// ... 5 6render() { 7 return ( 8 <div> 9 <button onClick={() => this.setState({ show: true })}>Alert</button> 10 <SweetAlert 11 show={this.state.show} 12 title="Demo" 13 text="SweetAlert in React" 14 onConfirm={() => this.setState({ show: false })} 15 /> 16 </div> 17 ); 18}
Since 0.6, you can wrap your own sweetalert2 (swal) instance:
1import React, { Component } from 'react'; 2import { withSwalInstance } from 'sweetalert2-react'; 3import swal from 'sweetalert2'; 4 5const SweetAlert = withSwalInstance(swal); 6 7// ... 8 9render() { 10 return ( 11 <div> 12 <button onClick={() => this.setState({ show: true })}>Alert</button> 13 <SweetAlert 14 show={this.state.show} 15 title="Demo" 16 text="SweetAlert in React" 17 onConfirm={() => this.setState({ show: false })} 18 /> 19 </div> 20 ); 21}
Tests were not updated to support sweetalert2. PRs are welcome.
MIT © C.T. Lin
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 9/29 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
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
Reason
79 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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