Toast V05

Author: Colorlib
Released: September 2026
License: CC BY 3.0
A loading toast that follows an upload: it shows a spinner and an indeterminate bar while the promise runs, then changes in place to a success or an error message. The success state links to the file and closes on its own; the error state stays until dismissed and offers a Retry button. The demo panel has one button for each outcome.
It is plain HTML and CSS plus a few lines of vanilla JavaScript: no jQuery, no Bootstrap files, no plugins, and the download is 193 KB. Use it on its own, or drop it into a Bootstrap 4, 5 or 6 project and it looks the same.
- One track(toast, promise) helper for any async task
- Content swaps in place, and errors are inserted with role="alert"
- Focus moves to the Retry or Open link if it was inside the toast
- Loading state never times out; success auto-dismisses and pauses on hover and focus
- Spinner slows and the indeterminate bar stops for reduced motion

