feedback
toast
Toast
Global toast stack via hx-swap-oob — the canonical sync-block pattern.
$
Component docs
ndui add toast
Trigger from the global window.toast API
The Showcase layout already mounts
<noundry-toast-container position="top-right" /> once
— that exposes window.toast.{level}(message)
globally. Server-side PageModel.AddToast(...) in the starter template buffers a TempData payload that the layout's bridge replays into window.toast.* on the next render.
Source
@* In _Layout.cshtml: *@
<noundry-toast-container position="top-right" />
@* From any client code: *@
window.toast.success('Saved.');
window.toast.error('Connection refused.');
@* From server code (with the starter's AddToast helper): *@
public IActionResult OnPostSave()
{
_products.Save(model);
this.AddToast("Saved.", ToastLevel.Success);
return RedirectToPage();
}