TooltipScope

sealed interface TooltipScope

Tooltip scope for TooltipBox to be used to obtain the LayoutCoordinates of the anchor content, and to draw a caret for the tooltip.

Functions

Link copied to clipboard
abstract fun Modifier.drawCaret(draw: CacheDrawScope.(LayoutCoordinates?) -> DrawResult): Modifier

Modifier that is used to draw the caret for the tooltip. A LayoutCoordinates will be provided that can be used to obtain the bounds of the anchor content, which can be used to draw the caret more precisely. PlainTooltip and RichTooltip have default implementations for their caret.

Link copied to clipboard
@Composable
fun TooltipScope.PlainTooltip(modifier: Modifier = Modifier, caretSize: DpSize = DpSize.Unspecified, shape: Shape = TooltipDefaults.plainTooltipContainerShape, contentColor: Color = TooltipDefaults.plainTooltipContentColor, containerColor: Color = TooltipDefaults.plainTooltipContainerColor, tonalElevation: Dp = 0.dp, shadowElevation: Dp = 0.dp, content: @Composable () -> Unit)

Plain tooltip that provides a descriptive message.

Link copied to clipboard
@Composable
fun TooltipScope.RichTooltip(modifier: Modifier = Modifier, title: @Composable () -> Unit? = null, action: @Composable () -> Unit? = null, caretSize: DpSize = DpSize.Unspecified, shape: Shape = TooltipDefaults.richTooltipContainerShape, colors: RichTooltipColors = TooltipDefaults.richTooltipColors(), tonalElevation: Dp = ElevationTokens.Level0, shadowElevation: Dp = RichTooltipTokens.ContainerElevation, text: @Composable () -> Unit)

Rich text tooltip that allows the user to pass in a title, text, and action. Tooltips are used to provide a descriptive message.