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 works