androidx.compose.material3

RichTooltip

Composable function

A part of TooltipBox. See that page for an overview and examples.

Parameters

@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,
)

title: (@Composable () -> Unit)?Optional

Default: null

A short title above the text of a rich tooltip.

action: (@Composable () -> Unit)?Optional

Default: null

A button in a rich tooltip, like "Learn more".

caretShape: (Shape)?OptionalSince 1.9

Default: null

A small arrow pointing at the element. null means no arrow.

maxWidth: DpOptionalSince 1.9

Default: TooltipDefaults.richTooltipMaxWidth

The widest the tooltip can be. Longer text wraps.

shape: ShapeOptional

Default: TooltipDefaults.richTooltipContainerShape

Sets the outline. See the Shapes guide.

colors: RichTooltipColorsOptional

Default: TooltipDefaults.richTooltipColors()

Sets the colors of a rich tooltip. Make one with TooltipDefaults.richTooltipColors.

tonalElevation: DpOptional

Default: ElevationTokens.Level0

Tints the background a little toward the primary color.

shadowElevation: DpOptional

Default: RichTooltipTokens.ContainerElevation

The size of the shadow under the tooltip.

text: @Composable () -> UnitRequired

The main text of a rich tooltip.

Same as in TooltipBox: modifier.

Parts