Skip to main content

Toast

shadow

The Toast component provides an unobtrusive way of displaying short notifications to the user. They are designed to appear and disappear seamlessly, ensuring that important information reaches users without being intrusive.

When to use

Use wje-toast to communicate status, result of actions, or required next steps immediately.

When not to use

Do not show multiple feedback channels for the same event unless there is a strong reason.

Accessibility

Announce status updates with suitable ARIA live regions and manage focus for modal interactions.

Best Practices

  • Match message severity (info/success/warning/error) to actual user impact.
  • Use confirmations only for destructive or hard-to-reverse actions.
  • Keep timeouts consistent so users have enough time to read messages.

Attributes and Properties

closable

DescriptionSet closable value of the toast.
Attributeclosable
Typeboolean
Defaultfalse

color

DescriptionSet color value of the toast.
Attributecolor
Typestring
Default-

countdown

DescriptionSet countdown value of the toast.
Attributecountdown
Typeboolean
Defaultfalse

duration

DescriptionSet duration value of the toast.
Attributeduration
Typenumber
Default-

headline

DescriptionSet headline value of the toast.
Attributeheadline
Typestring
Default-

icon

DescriptionSet icon value of the toast.
Attributeicon
Typestring
Default-

open

DescriptionSet open value of the toast.
Attributeopen
Typeboolean
Defaultfalse

Events

NameDescription
wje-toast:after-showFired after the toast is shown.
wje-toast:after-hideFired after the toast is hidden.

Methods

No public methods available for this component.

CSS Shadow Parts

NameDescription
nativeThe native part.

CSS Custom Properties

NameDescription
headlineSpecifies the headline text of the toast. Represents the main title or heading displayed in the toast.
openIndicates whether the toast is currently open (visible). A value of true shows the toast, while false hides it.
durationDetermines the duration (in milliseconds) for which the toast is displayed. After this time, the toast will automatically close unless it is manually closed.
closableSpecifies whether the toast can be manually closed by the user. If true, the toast will include a close button or mechanism.
colorDefines the color of the toast. Accepts any valid CSS color value such as hex, RGB, or named colors.
countdownIndicates whether a countdown is displayed in the toast. When true, a visual countdown timer is shown to indicate the remaining time before the toast closes.

Slots

NameDescription
defaultThe content of the toast.
mediaThe media of the toast.