showIf

fun Modifier.showIf(condition: Boolean): Modifier

Extension function for Modifier to conditionally show or hide a composable.

Return

A Modifier that is either the original or one with size 0.dp based on the condition.

Parameters

condition

Boolean value. If true, the Modifier is applied; otherwise, a Modifier with size 0.dp is applied.