Search documentation

Search guides, examples, and component APIs.

Quick links
↑↓ NavigateEnter OpenEsc Close
Get started

Blocks / Feedback & states

Toast notifications

A documents table where archive toasts with Undo, export turns one toast from progress into a download, and a failed sync stays until you retry.

bunx --bun @getweini/cli@latest add avatar badge button card toast
Customize
  • Mount `ToastProvider` once near your app root and render `ToastViewport` inside it. This block does both so it works alone; in an app, call `useToast()` from any child instead of the slot.
  • Pick the variant by what the person must do. Routine results use `info` or `success` and expire, while a failure that needs a decision uses `error` with `duration: 0` and a retry action.
  • Reuse the id returned by a toast and call `update` to turn a progress message into its result, so the viewport never stacks two messages about one task.
  • Archive is reversible, so it toasts with an `Undo` action instead of asking first. Use an alert dialog for work that cannot be undone. Set `duration` and `copy` to tune timing and wording.
  • `showcase` fires one archive, export, and sync toast on mount so a preview can show the stack; leave it off in an app. On phones the table becomes a list and Archive keeps its accessible name as an icon button.