then

inline fun Modifier.then(block: Modifier.() -> Modifier): Modifier

Appends a Modifier produced by block.

block receives an empty Modifier, allowing modifier extensions to be used without repeating Modifier in conditional or dynamic chains.

Example:

modifier.then {
when {
isSelected -> background(Color.Green)
isDisabled -> alpha(0.5f)
else -> this
}
}