State of Compose 2023 results are in! Click here to learn more

← Back to Material 3 Compose

PlainTooltipBox

Component
in
Material 3
. Since 1.1.0

Overview

Code Examples

Plain tooltip that provides a descriptive message for an anchor.

Tooltip that is invoked when the anchor is long pressed:

Overloads

PlainTooltipBox

@Composable
@ExperimentalMaterial3Api
fun PlainTooltipBox(
    tooltip: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    tooltipState: PlainTooltipState = rememberPlainTooltipState(),
    shape: Shape = TooltipDefaults.plainTooltipContainerShape,
    containerColor: Color = TooltipDefaults.plainTooltipContainerColor,
    contentColor: Color = TooltipDefaults.plainTooltipContentColor,
    content: @Composable TooltipBoxScope.() -> Unit
)

Parameters

NameDescription
tooltipthe composable that will be used to populate the tooltip's content.
modifierthe Modifier to be applied to the tooltip.
tooltipStatehandles the state of the tooltip's visibility.
shapethe Shape that should be applied to the tooltip container.
containerColorColor that will be applied to the tooltip's container.
contentColorColor that will be applied to the tooltip's content.
contentthe composable that the tooltip will anchor to