Sonner

Toast provider wrapping svelte-sonner. Mount the Toaster once at the app root, then call toast() from anywhere for stacked notifications that lift in from the edge of the viewport.

Mount the provider

Render <Toaster /> once — ideally in +layout.svelte. Bloom's wrapper tracks the data-theme attribute on <html> and swaps status icons for the Remix set (the -line glyphs).

The Toaster is already mounted on this page.

Variants

Five top-level calls. Each accepts a string or an options object with description, action, and duration.

With action

Pass action to render a trailing button — useful for undo, retry, or view-more flows.

Promise

toast.promise shows a spinner while the work runs, then morphs into success or error when the promise settles — no manual id juggling.

Rich colors

Enable per-toast via richColors: true in options, or globally via the richColors prop on <Toaster />. Tinted with the bloom-nx status palette — success / error / warning / info — using their -muted companions for surface and a 20%-alpha edge for the border.

Toaster props

Inherits every prop from svelte-sonner's Toaster. Bloom's wrapper sets theme, status icons, and popover-tinted surface automatically.

PropTypeDescription
'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'Screen corner the toast stack anchors to.
booleanTint success/error/warning/info toasts with their status color instead of neutral surface.
booleanShow a close affordance on each toast.
booleanExpand the stack on hover.
numberDefault auto-dismiss in ms. Override per-toast via the options arg.

toast() calls

Call from anywhere after the Toaster is mounted. Each variant accepts a string or an options object with description, action, and duration.

PropTypeDescription
(message, options?) => toastIdNeutral toast.
(message, options?) => toastIdSuccess variant — check-circle icon.
(message, options?) => toastIdError variant — warning-octagon icon, destructive tint with richColors.
(message, options?) => toastIdNeutral info toast with info icon.
(message, options?) => toastIdWarning toast with warning triangle icon.
(promise, { loading, success, error }) => toastIdShows a loading spinner, then morphs into success or error when the promise settles.