Skip to content

ToastManager

Defined in: src/core/toast.ts:49

Process-wide store of active toasts; <ToastHost> subscribes to render them. Prefer the toast façade.

new ToastManager(): ToastManager

ToastManager

get maxVisible(): number

Defined in: src/core/toast.ts:69

Cap on simultaneously-visible toasts. A burst beyond the cap queues; each queued toast is promoted (and its auto-dismiss countdown started) only when a visible slot frees up, so a flood can’t bury the screen. Default: unlimited.

number

set maxVisible(n): void

Defined in: src/core/toast.ts:72

number

void


get pendingCount(): number

Defined in: src/core/toast.ts:85

Number of toasts queued behind the maxVisible cap.

number

clear(): void

Defined in: src/core/toast.ts:134

Remove all toasts, visible and queued.

void


dismiss(id): void

Defined in: src/core/toast.ts:121

Remove the toast with id (visible or still queued).

number

void


getToasts(): readonly Toast[]

Defined in: src/core/toast.ts:80

Current visible toasts, oldest first. Stable reference between changes.

readonly Toast[]


notify(opts): number

Defined in: src/core/toast.ts:98

Raise a toast; returns its id for later dismiss.

ToastOptions

number


subscribe(cb): () => void

Defined in: src/core/toast.ts:90

Subscribe to changes; returns an unsubscribe function.

() => void

() => void


static getInstance(): ToastManager

Defined in: src/core/toast.ts:52

The shared singleton instance.

ToastManager