← Back to Material 3 Compose
RichTooltipBox
Component
in
Material 3
. Since 1.1.0Overview
Code Examples
Rich text tooltip that allows the user to pass in a title, text, and action. Tooltips are used to provide a descriptive message for an anchor.
Tooltip that is invoked when the anchor is long pressed:
Overloads
RichTooltipBox
@Composable
@ExperimentalMaterial3Api
fun RichTooltipBox(
text: @Composable () -> Unit,
modifier: Modifier = Modifier,
title: (@Composable () -> Unit)? = null,
action: (@Composable () -> Unit)? = null,
tooltipState: RichTooltipState = rememberRichTooltipState(action != null),
shape: Shape = TooltipDefaults.richTooltipContainerShape,
colors: RichTooltipColors = TooltipDefaults.richTooltipColors(),
content: @Composable TooltipBoxScope.() -> Unit
)
Parameters
Name | Description |
---|---|
text | the message to be displayed in the center of the tooltip. |
modifier | the Modifier to be applied to the tooltip. |
tooltipState | handles the state of the tooltip's visibility. |
title | An optional title for the tooltip. |
action | An optional action for the tooltip. |
shape | the Shape that should be applied to the tooltip container. |
colors | RichTooltipColors that will be applied to the tooltip's container and content. |
content | the composable that the tooltip will anchor to |