as Alert
Convenience extension function to display a ComponentValidationMessage as an alert.
The alert's severity and content are determined from the validation message's properties. Custom styling via the styling parameter is optionally supported, as well as any other customization via the build-lambda.
Usage example:
val message = infoMessage("SomeId", "This is a simple info message.")
// within some `RenderContext` so `this` refers to it
message.asAlert(this)See also
Parameters
RenderContext to render the alert in
a lambda expression for declaring the styling of the toast using fritz2's styling DSL
a lambda expression for setting up the component itself
Convenience extension to display a ComponentValidationMessage as an alert.
The alert's severity and content are determined from the validation message's properties. Customization of the underlying AlertComponent is supported via the build-lambda.
This variant does not offer custom styling. The latter can be applied via the overloaded ComponentValidationMessage.asAlert method.
Usage example:
val message = infoMessage("SomeId", "This is a simple info message.")
// within some `RenderContext` so `this` refers to it
message.asAlert(this)See also
Parameters
RenderContext to render the alert in
a lambda expression for setting up the component itself