sweet-alert

[![image](https://img.shields.io/badge/component-vanilla-green.svg?style=flat-square)](https://github.com/pemrouz/vanilla/#vanilla) [![Build Status](https://travis-ci.org/pemrouz/sweet-alert.svg)](https://travis-ci.org/pemrouz/sweet-alert) [![Coverage S

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
sweet-alert
012.0.56 years ago7 years agoMinified + gzip package size for sweet-alert in KB

Readme

sweet-alert
image Build Status Coverage Status
Browser Results A beautiful replacement for JavaScript's alert

Usage

In addition, there is a global swal helper since you mostly only want one instance.

State

  • title = '': The main heading to display
  • content = '': Extra HTML to display below the icon
  • type = 'warning': The icon type, can be warning | error | success | working
  • buttons = []: An array of objects representing the buttons to display, in the form of: { text, onClick, type }. onClick is the function to be invoked on clicked (closes the dialog if none omitted) and type is used to make the button primary (different colour).

API

  • close: Closes the dialog