AlertToastComponent

open class AlertToastComponent : ToastComponentBase

This class combines the configuration and the core styling of an alert-toast (toast containing an alert as it's content).

You can configure the following aspects:

  • position of the toast: top | topLeft | topRight | bottom (default) | bottomLeft | bottomRight

  • duration: time in ms before the toast is automatically dismissed - default is 5000 ms

  • isCloseable : if true, a close button is added for closing the toast before the duration timer hits zero

  • closeButtonStyle: style of the toast's close button, if displayed

  • background: background color of the toast

  • alert : all properties of the underlying alert

See ToastComponent if you need to define custom content.

Example on how to configure a toast (with manually created content):

showToast {
status { warning }
position { bottomRight }
duration { 8000 }

alert {
title("Alert")
severity { info }
// ...
}
}

Constructors

AlertToastComponent
Link copied to clipboard
js
fun AlertToastComponent()

Types

Companion
Link copied to clipboard
js
object Companion : ToastComponentBase.CloseMethodCompanion

Functions

render
Link copied to clipboard
js
open override fun render(styling: BoxParams.() -> Unit, baseClass: StyleClass, id: String?, prefix: String)
This method registers one toast at the central toast store and creates a rendering expression that will be executed by the central rendering in the companion's object ToastComponentBase.Companion init block.

Properties

alert
Link copied to clipboard
js
val alert: ComponentProperty<AlertComponent.() -> Unit>
background
Link copied to clipboard
js
val background: ComponentProperty<Colors.() -> ColorProperty>
closeButtonIcon
Link copied to clipboard
js
open override val closeButtonIcon: ComponentProperty<Icons.() -> IconDefinition>
closeButtonPrefix
Link copied to clipboard
js
open override val closeButtonPrefix: String
closeButtonRendering
Link copied to clipboard
js
open override val closeButtonRendering: ComponentProperty<RenderContext.() -> DomListener<MouseEvent, HTMLElement>>
closeButtonStyle
Link copied to clipboard
js
open override val closeButtonStyle: ComponentProperty<Style<BasicParams>>
duration
Link copied to clipboard
js
val duration: ComponentProperty<Long>
hasCloseButton
Link copied to clipboard
js
open override val hasCloseButton: ComponentProperty<Boolean>
placement
Link copied to clipboard
js
val placement: ComponentProperty<ToastComponentBase.Placement.() -> String>