No matches.
block
Default emphasis for pushed toasts when the input does not specify one. `"secondary"` is a calmer Alert variant. Per-toast overrides via `toast({ emphasis: "primary" })` are honored.
Render a thin progress bar at the bottom of each toast that animates to zero across the duration.
Render concurrent toasts as a deck (overlapping cards). Disable for a flat vertical list.
Notification center layout. `"right" | "left" | "top" | "bottom"` opens it as a side drawer; `false` opens it as a centered modal dialog.
Default viewport corner for spawned toasts. Per-toast overrides are honored.
Default auto-dismiss duration in milliseconds. Use `Infinity` on a single toast to make it sticky.
Track dismissed toasts in the history log. Required for the notification center.
When `stacked` is true, fan the deck out into a vertical list on pointer/focus enter.
Maximum number of concurrently visible toasts. Older toasts are evicted when the limit is exceeded.
Fired whenever the history array changes. Receives the full list.
Pause auto-dismiss timers (and the progress bar) while the toast is hovered or focus is inside it.
If provided AND `enableHistory` is true, the history is persisted to localStorage under this key.
Enable horizontal swipe-to-dismiss via pointer events (40px threshold).
Body text, an `HTMLElement`, or a render function `(container) => void`. The Svelte block accepts a string only inside the Toaster row template; use `toast.custom` for arbitrary content.
Visual emphasis. `"secondary"` (default) is a subtler, less attention-grabbing Alert variant — recommended for everyday tone. `"primary"` is the loud filled variant — reserve for critical / can't-miss messages.
Custom icon — an `HTMLElement` or an icon name string. Defaults to the icon for the toast `type`.
Heading text. When omitted the toast renders in a compact row layout (icon + content + close).
Visual tone. `"loading"` defaults to a sticky duration.
Override the toaster's default viewport corner for this toast.
Render an action button inline with the dismiss control. `onClick` fires when pressed.
Render inside the element with this id instead of the global viewport — useful for scoped toasters inside dialogs.
Override the toaster's default duration for this toast (ms). Use `Infinity` for a sticky toast.
Fired when the toast is removed from the screen (manual dismiss OR auto-close).
When `toast.update()` patches an existing toast, whether to restart the timer from zero. Use `false` for purely visual updates that shouldn't extend lifetime.
Play a short audio cue. `true` plays a built-in WebAudio blip per type; a string is treated as an audio URL.
When true, render as a custom (non-Alert) toast row. Internal, set by `toast.custom()`.
Open or close the built-in notification dialog. Pass `true`/`false` to force a state.