Skip to content

Zazzik1/zAlert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zAlert

Simple Alert in JS

Usage:

<script src="zAlert.js"></script>
zAlert.show(htmlStringOrElement, options)

Supported options:

Option Type Default Description
closeButton boolean true Used to hide the close button
duration number 300 Duration of the show/hide animations [ms]
hideOnBlur boolean true States if alert should be closed when clicked outside of it
bgColor string white Background color
color string rgb(40, 40, 40) Text color
borderColor string rgb(220, 220, 220) Border color

Examples:

await zAlert.show(`
  <div>Hello to zAlert</div>
  <input type="text" />
`)
await zAlert.show(`Custom styles`, {
  bgColor: '#3e6370',
  color: '#e0e0e0',
})
let input = document.createElement('input')
input.type = 'date'
await zAlert.show(input)

About

Simple Alert in JS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published