Skip to content

Tooltip

Tooltip is a retained modifier for concise labels or explanations revealed by hover, focus, or long press.

IconButton(images::refresh, "Refresh")
.With(Tooltip("Refresh messages"))

The message accepts StringVariant. Tooltip timing, placement, viewport margin, surface, typography, and touch duration come from TooltipStyle. Because the trigger already requires an accessible name, the tooltip supplements rather than replaces the control’s semantics.

Keep tooltip text concise and non-interactive. Use Popup when users must focus, activate, or navigate the floating content.

  • Tooltip(StringVariant message).
  • Tooltip::Descriptor() participates in retained modifier reconciliation.
  • TooltipStyle configures appearance and interaction timing.
  • Uses AnchorPlacement, AnchorSide, and AnchorAlignment.

See Popup for interactive floating content.

background, text_style, padding, shadow, and corner_radii style the hint. minimum_height and maximum_width constrain its surface. placement, gap, and viewport_margin set the preferred anchor relationship without allowing it to escape the viewport.

The timing fields are seconds: hover_delay before hover display, exit_delay before leaving, long_press_delay before touch activation, and touch_show_duration for touch visibility. Tune the inherited TooltipStyle rather than attaching a timer to each trigger. Tooltip supplies no user-managed LayerId or close button; it follows its retained trigger’s lifetime.

The public message field holds the StringVariant declaration. Descriptor() is modifier integration machinery, not an operation applications call to show the hint. Keep a stable accessible label on the trigger regardless of whether the visual hint is currently visible.