Skip to content
Communication

Tooltip

Plain tooltips anchored to an interactive element

Tooltips reveal a brief label for an element on long-press or hover. A TooltipBox positions a PlainTooltip relative to its anchor and is driven by a TooltipState that controls when the tooltip appears.

Tooltip demos rendered in Compose Playground
Pixel-accurate preview · light theme

Examples

01

Plain tooltip

Anchor a PlainTooltip to an IconButton via TooltipBox.

Kotlin
val state = rememberTooltipState()
TooltipBox(
    positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(),
    tooltip = { PlainTooltip { Text("More info") } },
    state = state
) {
    IconButton(onClick = {}) {
        Icon(Icons.Filled.Info, contentDescription = "Info")
    }
}