Meet
11/01/2025, 5:12 AMMeet
11/01/2025, 5:15 AM@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun CustomToolTip(
title: String,
description: String,
content: @Composable () -> Unit
) {
TooltipBox(
positionProvider = TooltipDefaults.rememberTooltipPositionProvider(TooltipAnchorPosition.Above),
tooltip = {
RichTooltip(
title = {
Text(
text = title,
style = MaterialTheme.typography.labelSmall
)
},
text = {
Text(
text = description,
style = MaterialTheme.typography.bodySmall
)
},
caretShape = TooltipDefaults.caretShape(TooltipDefaults.caretSize),
// caretSize = DpSize(16.dp, 8.dp),
colors = TooltipDefaults.richTooltipColors(
containerColor = MaterialTheme.colorScheme.surface,
contentColor = MaterialTheme.colorScheme.onSurface,
titleContentColor = MaterialTheme.colorScheme.primary,
actionContentColor = MaterialTheme.colorScheme.primary
)
)
},
state = rememberTooltipState(
isPersistent = true
),
content = content
)
}
this is current code it not workingMeet
11/01/2025, 5:18 AM@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun CustomToolTip(
title: String,
description: String,
content: @Composable () -> Unit
) {
TooltipBox(
positionProvider = TooltipDefaults.rememberRichTooltipPositionProvider(),
tooltip = {
RichTooltip(
title = {
Text(
text = title,
style = MaterialTheme.typography.labelSmall
)
},
text = {
Text(
text = description,
style = MaterialTheme.typography.bodySmall
)
},
caretSize = DpSize(16.dp, 8.dp),
colors = TooltipDefaults.richTooltipColors(
containerColor = MaterialTheme.colorScheme.surface,
contentColor = MaterialTheme.colorScheme.onSurface,
titleContentColor = MaterialTheme.colorScheme.primary,
actionContentColor = MaterialTheme.colorScheme.primary
)
)
},
state = rememberTooltipState(
isPersistent = true
),
content = content
)
}
this code worksGreg Steckman
12/20/2025, 10:49 PMTooltipAnchorPosition.Above position and it should get repositioned below the anchor. If I remove the caret or decrease the size of the content so it can be shown in the target position, there's no crash.Meet
12/21/2025, 8:32 AM