Toast
Feedbackatlas-toasterExamples
Variants
Call toast() from anywhere; the app renders one atlas-toaster at the root.
Duration and dismiss
duration (ms) keeps a toast longer than the toaster's default; toast() returns an id that toast.dismiss(id) uses to remove it early, for example when the work it reports finishes.
API
Generated from the library source, so it always matches the code.
AtlasToasterComponent atlas-toaster
| Input | Type | Default | Description |
|---|---|---|---|
| position | Position | 'top-right' | *-start / *-end follow the text direction. |
| richColors | boolean | true | false keeps them neutral. |
| duration | number | 4000 | duration wins. |
| visibleToasts | number | 4 | |
| closeButton | boolean | true |
Functions
| Function | Description |
|---|---|
| toast(message: string, options?: ExternalToast): number | atlas-toaster and returns its id. Typed variants: toast.success() , toast.error() , toast.warning() , toast.info() ; toast.dismiss(id) removes one early. |
Types
ExternalToast
| Property | Type | Description |
|---|---|---|
| description? | string | |
| duration? | number | duration . |
Position
*-start / *-end follow the text direction (an end toast is on the left under RTL); *-left / *-right stay physical.
type Position = | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end'ToastT
| Property | Type | Description |
|---|---|---|
| id | number | |
| message | string | |
| type | ToastTypes | |
| description? | string | |
| duration | number | duration . |
| createdAt | number | |
| dismissing? | boolean |
ToastTypes
type ToastTypes = 'default' | 'success' | 'error' | 'warning' | 'info'