New Compose Multiplatform components arrived on Composables UICheck it out →

TooltipArea

Sets the tooltip for an element.

Last updated:

Installation

dependencies {
   implementation("androidx.compose.foundation:foundation:1.7.0-beta03")
}

Overloads

@Composable
@OptIn(ExperimentalFoundationApi::class
fun TooltipArea(
    tooltip: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    delayMillis: Int = 500,
    tooltipPlacement: TooltipPlacement = TooltipPlacement.CursorPoint(
        offset = DpOffset(0.dp, 16.dp)
    ),
    content: @Composable () -> Unit
)

Parameters

namedescription
tooltipComposable content of the tooltip.
modifierThe modifier to be applied to the layout.
delayMillisDelay in milliseconds.
tooltipPlacementDefines position of the tooltip.
contentComposable content that the current tooltip is set to.