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 MeasureScope.obtainAnchorBounds(): LayoutCoordinates?

Used to obtain the LayoutCoordinates of the anchor content. This can be used to help draw the caret pointing to the anchor content.

Link copied to clipboard
abstract fun obtainPositionProvider(): PopupPositionProvider

Used to obtain the PopupPositionProvider used. This can be used to help draw the caret pointing to the anchor content.

Link copied to clipboard
@Composable
fun TooltipScope.PlainTooltip(modifier: Modifier = Modifier, caretShape: Shape? = null, maxWidth: Dp = TooltipDefaults.plainTooltipMaxWidth, 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, caretShape: Shape? = null, maxWidth: Dp = TooltipDefaults.richTooltipMaxWidth, 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.