ToastComponentBase

abstract class ToastComponentBase : ManagedComponent<Unit> , CloseButtonProperty

This class is the base for different types of toast-components and contains all necesserary logic except the content-related aspects. This way, different types of toasts with specific DSL variations can be implemented by inheriting from this base class and implementing the rendering logic exposed via the avstract renderContent method.

Currently, the following comppnents are part of the toast family:

See the respective subclass's documentation for more information and concrete usage examples.

Constructors

Link copied to clipboard
fun ToastComponentBase()

Types

Link copied to clipboard
open class CloseMethodCompanion

This class defines helpful methods to either close all currently open (closeAllToasts) or the last created toast (closeLastToast) which can be called via the companion objects of both ToastComponent and AlertToastComponent.

Link copied to clipboard
object Companion : ToastComponentBase.CloseMethodCompanion
Link copied to clipboard
object Placement
Link copied to clipboard
data class ToastFragment(    val id: String,     val placement: String,     val render: RenderContext.() -> Li)
Link copied to clipboard
object ToastStore : RootStore<List<ToastComponentBase.ToastFragment>>

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 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>

Inheritors

Link copied to clipboard
Link copied to clipboard