Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A simple, elegant snackbar notification component built with pure HTML5, CSS, and vanilla JavaScript, using Promises for async control.
Ui-Component-SnackBar is a lightweight snackbar notification component written in pure HTML5, CSS, and vanilla JavaScript that uses Promises to control the display of messages.
It takes a text message as input and displays it as a styled snackbar bar that appears and disappears, with its lifecycle managed by JavaScript Promises. It runs entirely in the browser without any backend or build step, making it a drop-in solution for any web page. The project is authored by Arslan Ameer and is hosted on GitHub with a live demo page.
The component exposes a function that returns a Promise when a snackbar is shown. The Promise resolves once the snackbar has finished its display duration, letting you write code like await showSnackbar('Hello') and then show the next message. Under the hood, it uses DOM creation and CSS transitions to animate the bar.
Free to use — the source code is publicly available in the GitHub repository, and the live demo allows immediate testing.
For other notification options, consider Toastify, a dependency-free toast library, and Noty, another popular notification library.
Yes, the project is open-source and available on GitHub. You can download or clone the repository and use the component in your own projects without payment or licensing fees.
No, it is built with pure vanilla JavaScript, HTML5, and CSS3. There are no dependencies on jQuery, React, Vue, or any other framework, so you can use it directly in any web page.
It creates a snackbar — a small, transient notification bar that appears at the bottom (or configured position) of the screen. You pass it a message, and it displays it for a short time before automatically dismissing it.
