A simple, good looking cookie alert for Bootstrap. No dependencies required.
We recommend using Bootstrap 4, but Boostrap 3 should work fine as well.
Demo (with Bootstrap 4)
I unfortunately dont remeber the source of the cubes pattern :( If someone know, please email me or create an issue. I would love to credit the author.
npm i bootstrap-cookie-alert
I try to keep it up-to-date. Let me know if I forget to release an update.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Wruczek/Bootstrap-Cookie-Alert@gh-pages/cookiealert.css">
<!-- START Bootstrap-Cookie-Alert -->
<div class="alert text-center cookiealert" role="alert">
<b>Do you like cookies?</b> 🍪 We use cookies to ensure you get the best experience on our website. <a href="https://cookiesandyou.com/" target="_blank">Learn more</a>
<button type="button" class="btn btn-primary btn-sm acceptcookies">
I agree
</button>
</div>
<!-- END Bootstrap-Cookie-Alert -->
<script src="https://cdn.jsdelivr.net/gh/Wruczek/Bootstrap-Cookie-Alert@gh-pages/cookiealert.js"></script>
Take a look at demo.html
for a working example
If you need to, you can listen for the cookieAlertAccept
event to get notified when the user accepts the cookies.
window.addEventListener("cookieAlertAccept", function() {
alert("cookies accepted")
})