We just launched Compose Examples featuring over 150+ components! Check it out →

minimumInteractiveComponentSize

Common

Modifier in Material Compose

Reserves at least 48.dp in size to disambiguate touch interactions if the element would measure smaller.

https://m2.material.io/design/usability/accessibility.html#layout-and-typography

This uses the Material recommended minimum size of 48.dp x 48.dp, which may not the same as the system enforced minimum size. The minimum clickable / touch target size (48.dp by default) is controlled by the system via [ViewConfiguration] and automatically expanded at the touch input layer.

This modifier is not needed for touch target expansion to happen. It only affects layout, to make sure there is adequate space for touch target expansion.

Because layout constraints are affected by modifier order, for this modifier to take effect, it must come before any size modifiers on the element that might limit its constraints.

Last updated:

Installation

dependencies {
   implementation("androidx.compose.material:material:1.8.0-alpha01")
}

Overloads


fun Modifier.minimumInteractiveComponentSize(): Modifier
by @alexstyl