# pointerHoverIcon

Common/AllAndroid/JVM

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/pointerHoverIcon.modifier#(androidx.compose.ui.Modifier).pointerHoverIcon(androidx.compose.ui.input.pointer.PointerIcon,kotlin.Boolean)( icon: https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerIcon, overrideDescendants: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Modifier that lets a developer define a pointer icon to display when the cursor is hovered over the element. | Cmn |

## Functions

### Modifier.pointerHoverIcon

Cmn Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/input/pointer/PointerIcon.kt+function:pointerHoverIcon) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.1.0)

```
fun Modifier.pointerHoverIcon(
    icon: PointerIcon,
    overrideDescendants: Boolean = false
): Modifier
```

Modifier that lets a developer define a pointer icon to display when the cursor is hovered over the element. When `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/package-summary#(androidx.compose.ui.Modifier).pointerHoverIcon(androidx.compose.ui.input.pointer.PointerIcon,kotlin.Boolean)` is set to true, descendants cannot override the pointer icon using this modifier.

```kotlin
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material3.Text
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.PointerIcon
import androidx.compose.ui.input.pointer.pointerHoverIcon

Column(Modifier.pointerHoverIcon(PointerIcon.Crosshair)) {
    SelectionContainer {
        Column {
            Text("Selectable text")
            Text(
                modifier = Modifier.pointerHoverIcon(PointerIcon.Hand, true),
                text = "Selectable text with hand",
            )
        }
    }
    Text("Just text with global pointerIcon")
}
```

| Parameters |
|---|---|
| `icon: https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerIcon` | the icon to set |
| `overrideDescendants: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | when false (by default), descendants are able to set their own pointer icon. If true, no descendants under this parent are eligible to change the icon (it will be set to the this (the parent's) icon). |