Skip to content

Non-intrusive notifications (toast/snackbar). A lightweight custom implementation with auto-dismiss, rich colors, and multiple positions.

atlas-toaster

Examples

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

InputTypeDefaultDescription
position Position'top-right' Corner or edge where toasts stack. *-start / *-end follow the text direction.
richColors booleantrue Colours toasts by type (success, error…); false keeps them neutral.
duration number4000 Default time (ms) a toast stays before it is dismissed; a toast's own duration wins.
visibleToasts number4 How many toasts are shown at once; older ones wait until newer ones leave.
closeButton booleantrue Shows a close button on each toast.

Functions

FunctionDescription
toast(message: string, options?: ExternalToast): number Shows a notification in the atlas-toaster and returns its id. Typed variants: toast.success() , toast.error() , toast.warning() , toast.info() ; toast.dismiss(id) removes one early.

Types

ExternalToast

Options passed to the toast() function

PropertyTypeDescription
description? string Second line under the message.
duration? number Time (ms) before this toast is dismissed. Defaults to the toaster's duration .

Position

Position for the toaster container. *-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

Internal toast representation

PropertyTypeDescription
id number —
message string —
type ToastTypes —
description? string —
duration number Time (ms) before it is dismissed; 0 means the toaster's duration .
createdAt number —
dismissing? boolean —

ToastTypes

Supported toast types

type ToastTypes = 'default' | 'success' | 'error' | 'warning' | 'info'