Get new jQuery plugins just once a week

×

sweetalert

October 10, 2014

A beautiful replacement for JavaScript’s “alert”

sweetalert is a javascript library to beautifully replace the default Javascript alert.
This plugin automatically centers itself on the page and looks great no matter if you’re using a desktop computer, mobile or tablet.

Example Code:

$(document).ready(function() {
swal({
title: "Error!",
text: "Here's my error message!",
type: "error",
confirmButtonText: "Cool"
});
});

Created by Tristan Edwards

Download

Example

sweetAlert jQuery plugin

modal

SweetAlert

A beautiful replacement for JavaScript's "alert"

npm version Build status

A success modal

Installation

$ npm install --save sweetalert

Usage

import swal from 'sweetalert'

swal("Hello world!")

Upgrading from 1.X

Many improvements and breaking changes have been introduced in the 2.0 release. Make sure you read the upgrade guide to avoid nasty suprises!

Guides

Documentation

Examples

An error message:

swal("Oops!", "Something went wrong!", "error")

A warning message, with a function attached to the confirm message:

A prompt modal, where the user's input is logged:

In combination with Fetch:

Contributing

If you're changing the core library:

  1. Make changes in the src folder.
  2. Preview changes by running npm run docs
  3. Submit pull request

If you're changing the documentation:

  1. Make changes in the docs-src folder.
  2. Preview changes by running npm run docs
  3. Run npm run builddocs to compile the changes to the docs folder
  4. Submit pull request
sweetalert

Related posts:

Apprise
CustomBox
Image-Lightbox

To install using Bower
bower install sweetalert

sweetAlert jQuery plugin

http://jquer.in/wp-content/uploads/2014/10/sweetAlert.jpg

jQuery plugin

Sign up for our weekly newsletter.

* We won't spam you ever