box

fun RenderContext.box(styling: FlexParams.() -> Unit = {}, baseClass: StyleClass = StyleClass.None, id: String? = null, prefix: String = "box", content: Div.() -> Unit): Div

This component represents the simplest layout component possible: A simple `div` that acts as a container for arbitrary content.

In fact it is more or less a shorthand for styling a `div` manually and so to avoid the cumbersome syntax of `BasicComponent.styled`

Example usage:

box({
/* styling expressions */
border {
color { dark }
size { normal }
style { solid }
}
}) {
p { +"Some content in the box" }
}

Parameters

styling

a lambda expression for declaring the styling as fritz2's styling DSL

baseClass

optional CSS class that should be applied to the element

id

the ID of the element

prefix

the prefix for the generated CSS class resulting in the form `$prefix-$hash`

content

a lambda expression for setting up the content and events of the `div` element itself