AlertComponent

open class AlertComponent : Component<Unit>

A component to display an alert consisting of an icon, title and description. Different styles based on severities are supported, as well as a number of different layout options.

Currently the following severities are available:

  • Info

  • Success

  • Warning

  • Error Specifying a severity will change the alert's color scheme based on the colors defined in the application theme as well as the icon displayed. If no severity is specified, 'info' will be used by default. The alert's icon can manually be overridden by setting the respective dsl property.

Additionally, a number of different layout options are available. These are:

  • 'subtle': A subtle style using different shades of the severity's base color defined in the application theme.

  • 'solid': A solid style using the severity's color from the application theme and a solid white color for the icon, text and decorations.

  • 'leftAccent': A variation of the 'subtle' variant with a decoration element at the top.

  • 'topAccent': A variation of the 'subtle' variant with a decoration element on the left.

  • 'ghost': This variant does not have any decoration besides the icon (no background, similar to 'ghost' in push-buttons) If no variant is specified, 'solid' is used by default.

Usage examples:

alert {
title("Alert")
content("This is an alert.")
severity { info }
}

alert {
title("Alert")
content("This is an alert.")
severity { error }
variant { leftAccent }
}

alert {
title("Alert")
content("This is an alert.")
icon { fritz2 }
}

Constructors

Link copied to clipboard
fun AlertComponent()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
enum Variant : Enum<AlertComponent.Variant>
Link copied to clipboard
object VariantContext

Functions

Link copied to clipboard
fun content(value: RenderContext.() -> Unit)
fun content(value: String)
fun content(value: Flow<String>)
Link copied to clipboard
open override fun render(    context: RenderContext,     styling: BoxParams.() -> Unit,     baseClass: StyleClass,     id: String?,     prefix: String)

Central method that should do the actual rendering of a component.

Link copied to clipboard
fun title(value: RenderContext.() -> Unit)
fun title(value: String)
fun title(value: Flow<String>)

Properties

Link copied to clipboard
val icon: ComponentProperty<Icons.() -> IconDefinition?>
Link copied to clipboard
val severity: ComponentProperty<AlertSeverities.() -> AlertSeverity>
Link copied to clipboard
val size: ComponentProperty<FormSizesStyles.() -> Style<BasicParams>>
Link copied to clipboard
val stacking: ComponentProperty<AlertStacking.() -> Style<BasicParams>>
Link copied to clipboard