CustomAlerts is a very simple and lightweight alerts system created with vanilla JS.
let alerts = new CustomAlerts({
autoclose: 0
});
alerts.alert({
title:'Default alert',
content: 'Hello World!',
})
alerts.alert({
type: 'info',
title:'Info alert',
content: 'Hello World!',
})
alerts.alert({
type: 'warning',
title:'Waning alert',
content: 'Hello World!',
})
alerts.alert({
type: 'danger',
title:'Waning alert',
content: 'Hello World!',
})
alerts.alert({
title: 'Hi buddy!',
content: 'How are you?'
})
alerts.alert({
type: 'warning',
title: 'I\'m angry 😡',
content: 'You can create all you want classes in css'
})
alerts.alert({
title: 'Autoclose alert',
content: 'This alert will close in 2 seconds 👋',
autoclose: 2000
})
alerts.alert({
title: 'Alert delay of 1 second',
content: 'I was a little late 🥺',
delay: 1000
})
alerts.alert({
title: 'Alert with delay and autoclose',
content: '2 seconds of delay
5 seconds to auto close',
delay: 2000,
autoclose: 5000
})
alerts.alert({
title: 'The alerts supports html code',
content: 'Spoiler
👻 BOOOoo!!!'
})
Thanks to Rainbow for syntax highlighting