onHover

fun Modifier.onHover(onHover: (Boolean) -> Unit): Modifier

A modifier extension function that adds hover detection to a composable.

This function adds a pointer input handler that detects when the pointer enters or exits the composable and invokes the provided callback with the hover state.

Return

A modifier with hover detection

Parameters

onHover

Callback to invoke when the hover state changes