API reference
@salmonui/notifications/toast
16 exported symbols: 3 functions, 10 interfaces and 3 types. Each name links its page with the signature, docs and members.
import { … } from '@salmonui/notifications/toast';Functions
ToasterToaster. Styling hooks: .salmon-toaster (data-placement, data-paused, data-scoped), its .salmon-toaster-list; .salmon-toast (data-tone, data-closing) with part…createToastQueueCreates a toast queue. Call it in a client module or in an effect, never at render time.useToastThe queue of the nearest Toaster. Throws outside a Toaster.
Interfaces
ToastActionA button in the toast.ToastBeforeCloseEventPassed to onBeforeClose; preventDefault() keeps the toast open.ToastCloseEventPassed to onClose.ToastOptionsThe object passed to queue.add() and queue.update().ToastQueueA toast queue: create one with createToastQueue() or let Toaster create it.ToastQueueOptionsToastQueueSnapshotWhat getSnapshot() returns; a new object on every change.ToastStateA toast in the queue: its options plus store state.ToasterLocaleTextStrings of Toaster.ToasterProps
Types
ToastCloseReasonWhy a toast closed.ToastPlacementWhere the region sits; logical, so Start / End follow dir.ToastToneColor role: the neutral scale plus the five theme seeds.