Get started with snackbarjs CDN

ISC licensed

Library: SnackbarJS - Displays temporary messages as material design snackbars in browsers.

Tags:
  • snackbarjs

Stable version

Copied!

How to start using snackbarjs CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with snackbarjs CDN - cdnhub.io</title>
    <style>
        .snackbar-container {
            z-index: 9999;
            right: 30px;
            bottom: 30px;
        }
    </style>
</head>
<body>
    <button id="showSnackbar">Show Snackbar</button>
    <script src="https://cdn.cdnhub.io/snackbarjs/1.1.0/snackbar.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', () => {
            const data = new Snackbar('My awesome snackbar!');
            document.getElementById('showSnackbar').addEventListener('click', () => {
                data.show();
            });
        });
    </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!

All versions