Toast
A short message about something that happened in the background.
Examples
- Q1 holdings report
- Q2 holdings report
- Q3 holdings report
Usage
Use it when
- Something finished while you were elsewhere on the page: an export is ready, a background sync failed, an item was archived from a swipe and can be undone.
- A result has no control of its own left on screen to report it, such as after a dialog closed or a row was removed.
Use something else when
- The control that was pressed is still on screen and can report its own result. Use StateButton instead, which settles into "Saved" in place.
- The result is an error you must act on in a form. Use Dialog's
DialogError, or Field'sFieldErroron the field, instead, which stay until fixed. - The wait itself needs reporting, not its end. Use Spinner inside the control, or ListBody over the rows, instead.
- The message is a confirmation that needs a decision. Use AlertDialog instead.
Rules
General
Content
Avoid
Limits
Install
npx shadcn@latest add https://kaanarici.com/r/cobalt/toaster.jsonimport { Toaster, toast } from "@/components/cobalt/ui/toaster"Related
- Emptysays what a list has none of, and offers the one next step, in the place where the rows would be.
- Alerta message that stays on the page until its cause is fixed.
- Bannera line at the foot of the window for news or a lost connection, until it is resolved.
- Inboxthe bell in a top bar that opens the person's notifications.
