also

fun also(expr: R.() -> Unit)

This method offers the created result as receiver within a context expression in order to expose some additional configuration entry point for a client.

This is also the most unspecific way to configure the behaviour of a hook.

That's why it is intentionally a terminal operation, thus no other configuration function of a hook can be chained after. The more specific ones are enforced to appear closer to the invoke call though.

Example:

btn {
icon(someIcon) // main configuration
.right() // some additional, component specific and precise configuration
.also { // final block of various additional configuration
className("text-red-500")
}
// no more chaining possible
}

Parameters

expr

Tag specific configuration expression with optional applied classes injected for possible extension