a-toast
A Blur is a wrapper element which can show and hide its children.
Implemented with Toast.
Toast
A single toast element.
Example
import "@sv/elements/toast";
// create a toas and keep a reference to it
const toast = new Toast({ message: "A Message" });
const feed = ToastFeed.getInstance(); // the a-toast-feed element
feed?.append(toast);
// optionally slot any content into the toast
toast.innerHTML = `
<span>Custom HTML content</span>
`; Events
| Name | Description |
|---|---|
killed
|
Fires when the toast is killed. |
Methods
Toast.dismiss()
src/Toast.ts:215
ToastFeed
A feed of toast elements. Handles the positioning and animations of the toasts.
Example
import "@sv/elements/toast";
<a-portal>
<a-toast-feed class="fixed right-12 bottom-12 text-base" />
</a-portal>