Skip to main content

tooltip_provider

Function tooltip_provider 

Source
pub fn tooltip_provider(message: impl Into<String>) -> TooltipProviderBuilder
Expand description

§tooltip_provider

Host a contextual explanation above page content for a control or action.

§Usage

Wrap a page and place its trigger inside tooltip_anchor.

§Parameters

  • message — supporting text shown in the popup
  • variant, headline — plain or rich appearance and optional rich title
  • action_label, on_action — optional rich action, which dismisses the popup
  • actions — custom rich actions, replacing the default text action
  • controller — optional shared visibility state for the provider and anchor
  • placement — preferred side, with edge avoidance and opposite-side fallback
  • persistent — keep a touch-triggered popup open until dismissal
  • modifier — modifiers for the page-sized host
  • popup_modifier — modifiers for the tooltip container
  • child — page content, containing one anchor for this provider

§Examples

use tessera_components::tooltip::TooltipController;
let mut tooltip = TooltipController::new();
assert!(!tooltip.is_open());
tooltip.show();
assert!(tooltip.is_open());
tooltip.dismiss();
assert!(!tooltip.is_open());