Skip to content

rez1Pro/cute-alert-latest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cute Alert

img

I created this JS library as an open-source project (for studying purposes) to provide beautiful alert box messages made with HTML, CSS and JS only. Feel free to contribute with a pull request or suggestions.

Installation Instructions

  • Clone this repository into your project's lib folder.
  • Import both "style.css" and "cute-alert.js" into your code just like described on the image below:

img

Docs

It's way too simple for you to import this lib into your code, all you have to do is call cuteAlert() and pass its arguments in object notation.

buttonText is an optional parameter, by default it's set as "OK".

type will define what kind of alert box will be shown.

img img img img

cuteAlert()returns a Promise, so you can use then to execute an action after the alert box frame is closed.

img

As for the question alert box, you can choose what you want to do after any of the buttons is pressed with then aswell.

confirmText and cancelText are both optional, by the default they are set as "Confirm" and "Cancel" respectively.

img

Close button as a circle

If you wish to have the close button styled as a circle, you need to pass closeStyle: "circle" as an argument in cuteAlert().

img

Toasts

It's even easier to use toasts, all you have to do is call cuteToast() and pass type, message and timer(in miliseconds) as its arguments.

img img img img

It also returns a Promise, so you can use then to execute an action after the toast is closed or reaches its end by a timer.

Alert Box Design

Dev

Contributors

About

This cute alert is updated now!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •