showToast function presentation exported
Last updated: 2026-03-04T23:21:38.429Z
Location
Metrics
LOC: 14
Complexity: 2
Params: 2
Signature
showToast(message: string, type: ToastType = "success"): : void
Source Code
export function showToast(message: string, type: ToastType = "success"): void {
const existing = document.querySelector(".toast");
if (existing) existing.remove();
const toast = document.createElement("div");
toast.className = `toast toast-${type}`;
toast.textContent = message;
document.body.appendChild(toast);
setTimeout(() => {
toast.style.opacity = "0";
setTimeout(() => toast.remove(), 300);
}, 2500);
}
No outgoing dependencies.
Impact (Incoming)
| Source | Type |
|---|---|
| LearnedEntryView | uses |
| loadModelStatus | uses |
| fieldTypeLabel | uses |
| loadRules | uses |
| debounce | uses |