Skip to content

Toast - Web Component

...

Browser support

Detected engine:  

  • Chromium

  • Webkit

  • Gecko

Parameters

The Web component uses the <z-toast> tag:

By default, all the parameters are optional or can be set in different, except for the ones marked as required

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescriptionSlot
configstring

Setting this attribute to a div tag will render a toast component. Possible values are: info, alert, negative, positive.

timestampstringThe timestamp of the toast. If not, current time is used
contentstringThe text of the toastdefault

The available slots for the component are:

NameTagsDescription
defaultspanThe content of the toast
timestampspanThe timestamp of the toast

config

The config parameter is used to define the toast status. Possible values are: info, alert, negative, positive. Being omitted, the default value is info.

Toast textToast textToast textToast text

timestamp

The timestamp parameter is used to define the time to be displayed in the toast. The format must be HH:mm. If not set, the current time will be used.

Toast textToast text

You can also set the timestamp using the timestamp slot.

Toast text 23:59

Both background color and text color can be customized using the --z-toast--bg and --z-toast--color CSS custom properties, respectively.

Custom toast

Playground

Customization

HTML Examples

StackBlitz example