Toast

Non-blocking, temporary notifications managed by a global ToastManager. Use Root once in your application layout (it creates the manager and mounts ToastContainer); call getToastManager() anywhere in the tree to trigger toasts.


Basic Usage

Call toastManager.show() with a message. Dismisses automatically after 3 seconds.


Toast Types

Use the type option to change the accent color and default icon.


Custom Icon

Pass an icon to override the default type icon.


Duration

Control visibility duration. Set duration: 0 for a persistent toast that can close via its button, action or manager.dismiss(id).


With Action

Include an action button with a callback using the action option.


Custom Component

Use showCustom() to render any Svelte component as a toast. In 0.0.34, only your supplied props reach the component. Capture the returned id and pass an explicit onclose callback to dismiss it. Custom content must render its own close/action controls; options still control the manager’s auto-dismiss timer.


Application setup

Place Root in the application layout, not inside each example. Context getters must run during component initialization under this provider.