sweet-alert
v2.0.5
Published
[![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
1,192
Readme
sweet-alert
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 displaycontent = ''
: Extra HTML to display below the icontype = 'warning'
: The icon type, can bewarning | 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) andtype
is used to make the buttonprimary
(different colour).
close
: Closes the dialog