This feature is currently available as an early access Beta
preview, meaning the features and API are not yet stable. This feature is not yet recommended for production use as breaking changes may occur. Please use this feature with caution.
Setup the Provider
Wrap the contents of your app with ToastProvider
in your root layout. We’ll interface with this using the Svelte Context API.
Create a Toast
There are three available types of toasts: info | error | success
, with info
being the default.
API Reference
ToastProvider
Property | Type | Description |
---|---|---|
placement | "top-start" | "top-end" | "bottom-start" | "bottom-end" | |
offset | string | |
dismissLabel | string | |
groupBase | string | |
groupZIndex | string | |
groupGap | string | |
groupClasses | string | |
toastBase | string | |
toastPadding | string | |
toastGap | string | |
toastShadow | string | |
toastClasses | string | |
messageBase | string | |
messageTitle | string | |
messageDescription | string | |
messageClasses | string | |
btnDismissBase | string | |
btnDimissPreset | string | |
btnDismissHover | string | |
btnDismissClasses | string | |
stateInfo | string | |
stateError | string | |
stateSuccess | string | |
children | Snippet<[]> | |