alert Toast
fun alertToast(styling: BasicParams.() -> Unit = {}, baseClass: StyleClass = StyleClass.None, id: String? = null, prefix: String = "toast-alert", build: AlertToastComponent.() -> Unit): SimpleHandler<Unit>
Content copied to clipboard
This factory method creates a toast with an alert as it's content that will be shown when the returned handler is triggered, eg. on a button press (similar to toast). The same configuration options as in showAlertToast are provided.
Please note: All parameters (styling, id, prefix, etc.) are applied to the alert, not the toast.
Usage example:
clickButton {
variant { outline }
text("New alert-toast")
} handledBy alertToast {
// configuration of the toast:
duration(9000)
position { bottomRight }
// configuration of the alert:
alert {
title("AlertToast!")
content("This is an alert in a toast.")
}
}Parameters
styling
lambda expression for declaring the styling of the toast using fritz2's styling DSL
baseClass
optional CSS class that should be applied to the toast element
id
ID of the toast element
prefix
prefix for the generated CSS class of the toast element resulting in the form `$prefix-$hash`
build
a lambda expression for setting up the component itself