Skip to content

Alert - Web Component

Browser support

Detected engine:  

  • Chromium

  • Webkit

  • Gecko

Parameters

The Web component uses the <z-alert> 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

Defines the state of the alert. Possible values are:

info, alert, negative and positive

contentstringThe content of the alert.default
confirm-textstringThe text of the button.confirm-text
hide-closebooleanHides the close button

The events emitted from the component are:

NamePayloadDescription
confirmvoidFired when the user confirms the alert.
closevoidFired when the user closes the alert.

The available slots for the component are:

NameTagsDescription
defaultspan
confirm-textspan

config

The config attribute is used to set the state of the alert. Possible values are: info, alert, negative and positive.

This is an info alert This is an alert alert This is a negative alert This is a positive alert

confirm-text

The confirm-text attribute is used to set the text of the confirm button.

This is an info alert

Both background color and text color can be customized using the --z-alert--bg and --z-alert--color tokens.

Custom alert

Playground

Customization

HTML Examples

StackBlitz example