# Toast (@limerdev/zest) A short message that appears at the edge of the screen and closes by itself: put one `` 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. - Category: Feedback - Import: `import { Toaster, toast } from '@limerdev/zest'` - Exports: `Toaster`, `toast` - 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`. ```svelte ``` Props of `Toaster`: - `closeLabel` (`string`, default `the Config's `strings.close`, else 'Close'`): The name of each toast's close button. - `hotkey` (`string`, default `'F8'`): The key (`KeyboardEvent.key`) that moves focus to the toasts and back. - `label` (`string`, default `the Config's `strings.notifications`, else 'Notifications'`): The name of the notifications landmark; the hotkey is added to it. - `position` (`"top-start" | "top-center" | "top-end" | "bottom-start" | "bottom-center" | "bottom-end"`, default `'bottom-end'`): The corner or edge of the screen the toasts appear in. Example: Variants toast() and its variants. The app's root layout has the one . ```svelte
``` Example: Undo and progress An action button (Undo), and an id to update one toast as work goes on. ```svelte
Deleted: {deleted}
```