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

Link copied to clipboard
fun AlertToastComponent()

Types

Link copied to clipboard
object Companion : ToastComponentBase.CloseMethodCompanion

Functions

Link copied to clipboard
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

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