Toast

Feedback

A short message that appears at the edge of the screen and closes by itself: put one <Toaster> in the app's root layout (position, label, closeLabel), then call toast('Saved') from anywhere in the browser. toast.success, toast.info, toast.warning and toast.error set the variant and its icon; options add a description, an action button (Undo), a duration (5 s; an error stays until closed) or an id to update a toast in place. toast.dismiss(id) closes one, toast.dismiss() all. Screen readers hear each toast once (an error as an alert). The timers pause while the pointer is over the toasts or focus is in them; F8 moves focus to them and back, and Escape closes the focused one.

import { Toast } from '@limerdev/zest';
Toast for AI tools (llms.txt)
Use for
Confirming what just happened, out of the way: "Invoice sent", "Copied", "Saved, Undo". A background job finishing.
Don't
Something people must read or act on before going on: use Alert in the page or AlertDialog. A field's error: use Field.Error. More than a line or two, or links to read: use Alert.

Examples

Variants

toast() and its variants. The app's root layout has the one <Toaster />.

Undo and progress

An action button (Undo), and an id to update one toast as work goes on.

Deleted: 0