Tooltip

fun TileSchemaBuilderScope.Tooltip(id: String = randomId(), style: StyleSchemaBuilderScope.() -> Unit = {}, visibility: TileSchema.Visibility = visible(), searchableTerms: List<String>? = null, text: String, position: TooltipTileSchema.Position = tooltipPositionAbove(), spacing: Int? = null, showCaret: Boolean = false, maxWidth: Int? = null, shape: ShapeSchema? = null, contentColor: ColorSchema? = null, containerColor: ColorSchema? = null, events: EventSchemaBuilderScope.() -> Unit = {}, tiles: TileSchemaBuilderScope.() -> Unit)

Wraps tiles in a Material 3 plain tooltip showing text. The tooltip is driven entirely by the platform's own gestures (long press on touch, hover on pointer devices) — the server neither opens nor observes it. position places the tooltip relative to the anchor and spacing (dp) sets the gap from it, defaulting to Material's own spacing when null. showCaret toggles the little pointer arrow, and maxWidth, shape, contentColor and containerColor each override the corresponding Material default when non-null. style and visibility apply to the anchor, not to the tooltip surface, whose look is controlled by the fields above. Only plain tooltips are supported — there is no rich variant with a title and actions. Dispatches no triggers at all — wire events on the wrapped tiles instead.

Parameters

id

Unique identifier of the tile. Defaults to a random id.

style

Layout/appearance modifiers applied to the anchor (size, padding, background, etc).

visibility

Whether the anchor is shown, hidden but occupies space, or removed from layout. Defaults to visible.

searchableTerms

Terms used by an ancestor's search/filter to decide whether this tile matches. Defaults to none.

text

Text shown inside the tooltip.

position

Placement of the tooltip relative to the anchor. Defaults to above.

spacing

Gap between the tooltip and the anchor, in dp. Defaults to none (Material's own spacing).

showCaret

Whether to show the little pointer arrow. Defaults to false.

maxWidth

Maximum width of the tooltip, in dp. Defaults to none (Material default).

shape

Corner shape of the tooltip surface. Defaults to none (Material default).

contentColor

Color of the tooltip's text. Defaults to none (Material default).

containerColor

Background color of the tooltip surface. Defaults to none (Material default).

events

Events owned by this tile. Never fired, since the tile dispatches no triggers.

tiles

Child tiles forming the anchor the tooltip is attached to.