Toast Component Base
abstract class ToastComponentBase : ManagedComponent<Unit> , CloseButtonProperty
Content copied to clipboard
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:
ToastComponent (created via toast and showToast)
AlertToastComponent (created via alertToast and showAlertToast)
See the respective subclass's documentation for more information and concrete usage examples.
Constructors
ToastComponentBase
Link copied to clipboard
fun ToastComponentBase()
Content copied to clipboard
Types
CloseMethodCompanion
Link copied to clipboard
open class CloseMethodCompanion
Content copied to clipboard
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.
Companion
Link copied to clipboard
ToastFragment
Link copied to clipboard
data class ToastFragment(id: String, placement: String, render: RenderContext.() -> Li)
Content copied to clipboard
ToastStore
Link copied to clipboard
Functions
render
Link copied to clipboard
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
background
Link copied to clipboard
closeButtonIcon
Link copied to clipboard
open override val closeButtonIcon: ComponentProperty<Icons.() -> IconDefinition>
Content copied to clipboard
closeButtonPrefix
Link copied to clipboard
closeButtonRendering
Link copied to clipboard
open override val closeButtonRendering: ComponentProperty<RenderContext.() -> DomListener<MouseEvent, HTMLElement>>
Content copied to clipboard
closeButtonStyle
Link copied to clipboard
open override val closeButtonStyle: ComponentProperty<Style<BasicParams>>
Content copied to clipboard
duration
Link copied to clipboard
hasCloseButton
Link copied to clipboard
placement
Link copied to clipboard
val placement: ComponentProperty<ToastComponentBase.Placement.() -> String>
Content copied to clipboard