Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Sweetalert | 22,235 | 3,180 | 222 | 2 months ago | 22 | October 29, 2018 | 191 | mit | TypeScript | |
A beautiful replacement for JavaScript's "alert" | ||||||||||
Sweetalert2 | 15,925 | 3,446 | 780 | 6 days ago | 634 | September 13, 2022 | 7 | mit | JavaScript | |
✨ A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies. 🇺🇦 | ||||||||||
React Native Dropdownalert | 1,733 | 203 | 15 | 2 months ago | 60 | January 04, 2022 | 26 | mit | JavaScript | |
A simple alert to notify users about new chat messages, something went wrong or everything is ok. | ||||||||||
Chronograf | 1,427 | 1 | a month ago | 43 | April 01, 2022 | 34 | other | TypeScript | ||
Open source monitoring and visualization UI for the TICK stack | ||||||||||
React S Alert | 660 | 646 | 70 | 4 years ago | 17 | January 22, 2018 | 31 | mit | JavaScript | |
Alerts / Notifications for React with rich configuration options | ||||||||||
React Alert | 559 | 426 | 31 | 2 years ago | 49 | May 06, 2021 | 5 | mit | JavaScript | |
alerts for React | ||||||||||
React Ui Library Tutorial | 360 | 6 months ago | 22 | August 10, 2021 | 1 | TypeScript | ||||
📚React组件库搭建指南 | ||||||||||
React Redux Starter Kit | 360 | 6 years ago | 2 | mit | JavaScript | |||||
Enjoy React, Redux, and React-Router, with zero build configuration. | ||||||||||
Sp React Native In App Updates | 282 | 20 days ago | 22 | September 16, 2022 | 42 | mit | TypeScript | |||
An in-app updater for the native version of your react-native app. | ||||||||||
Pile.js | 262 | 2 | 8 | 3 years ago | 5 | April 24, 2019 | 5 | apache-2.0 | CSS | |
pile.js components build with React. |
A beautiful replacement for JavaScript's "alert"
$ npm install --save sweetalert
import swal from 'sweetalert';
swal("Hello world!");
Many improvements and breaking changes have been introduced in the 2.0 release. Make sure you read the upgrade guide to avoid nasty surprises!
swal("Oops!", "Something went wrong!", "error");
swal({
title: "Are you sure?",
text: "Are you sure that you want to leave this page?",
icon: "warning",
dangerMode: true,
})
.then(willDelete => {
if (willDelete) {
swal("Deleted!", "Your imaginary file has been deleted!", "success");
}
});
const willDelete = await swal({
title: "Are you sure?",
text: "Are you sure that you want to delete this file?",
icon: "warning",
dangerMode: true,
});
if (willDelete) {
swal("Deleted!", "Your imaginary file has been deleted!", "success");
}
swal("Type something:", {
content: "input",
})
.then((value) => {
swal(`You typed: ${value}`);
});
const value = await swal("Type something:", {
content: "input",
});
swal(`You typed: ${value}`);
swal({
text: "Wanna log some information about Bulbasaur?",
button: {
text: "Search!",
closeModal: false,
},
})
.then(willSearch => {
if (willSearch) {
return fetch("http://pokeapi.co/api/v2/pokemon/1");
}
})
.then(result => result.json())
.then(json => console.log(json))
.catch(err => {
swal("Oops!", "Seems like we couldn't fetch the info", "error");
});
const willSearch = await swal({
text: "Wanna log some information about Bulbasaur?",
button: {
text: "Search!",
closeModal: false,
},
});
if (willSearch) {
try {
const result = await fetch("http://pokeapi.co/api/v2/pokemon/1");
const json = await result.json();
console.log(json);
} catch (err) {
swal("Oops!", "Seems like we couldn't fetch the info", "error");
}
}
SweetAlert has tools for integrating with your favourite rendering library..
If you're using React, you can install SweetAlert with React in addition to the main library, and easily add React components to your alerts like this:
import React from 'react'
import swal from '@sweetalert/with-react'
swal(
<div>
<h1>Hello world!</h1>
<p>
This is now rendered with JSX!
</p>
</div>
)
Read more about integrating with React
src
folder.npm run docs
docs-src
folder.npm run docs
npm run builddocs
to compile the changes to the docs
folderThis project exists thanks to all the people who contribute. [Contribute].
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]