Toast
Static toasts (inline)
Profile updated
Your display name and avatar have been saved.
Invoice sent
Invoice #1042 has been emailed to the client.
Session expiring in 5 minutes
Save your work now to avoid losing unsaved changes.
Payment failed
Please check your card details and try again.
Imperative (click to dispatch)
Title only
With description
Usage
use maud_ui::primitives::toast;
// Add the viewport container once in your layout
let vp = toast::viewport();
// Render a toast notification
let html = toast::render(toast::Props {
title: "Changes saved".into(),
description: Some("Your profile was updated.".into()),
variant: toast::Variant::Success,
duration_ms: 5000,
id: "save-toast".into(),
});
// Trigger from JS: muiToast({ title, description, variant })