🌈 Create new beautiful Compose Gradients with our new wesite ->

RichTooltip

Kotlin
@Composable
fun RichTooltipSample() {
    val tooltipState = rememberTooltipState(isPersistent = true)
    LaunchedEffect(Unit) {
        tooltipState.show()
    }

    TooltipBox(
        positionProvider = TooltipDefaults.rememberTooltipPositionProvider(
            TooltipAnchorPosition.Above
        ),
        tooltip = {
            RichTooltip(
                title = { Text("Share this item") },
                action = { TextButton(onClick = {}) { Text("Share") } },
            ) {
                Text("Anyone with the link can view it.")
            }
        },
        hasAction = true,
        state = tooltipState,
    ) {
        IconButton(onClick = {}) {
            Icon(Icons.Filled.Info, contentDescription = "More information")
        }
    }
}