Tooltip❖

Module path❖
kivydk.uix.behavior.tooltip

Overview❖

TooltipBehavior does not create or manage tooltip widgets directly. Instead, it exposes a small set of properties that describe how a tooltip should be rendered and positioned. TooltipManager reads these properties and applies the appropriate defaults or overrides when showing a tooltip for the widget.


Reference❖

class TooltipBehavior(**kwargs)❖

Bases: object

Declarative behavior that adds tooltip configuration to widgets.

When a property is None, TooltipManager falls back to its own default value. This allows widgets to customize only the aspects they need while preserving a consistent global tooltip style and behavior across the application.

Events

Todo

The current event implementation relies on __events__ being defined as a class attribute. This works for now, but it overrides inherited Kivy events.

When revisiting the event system, consider migrating to register_event_type() and updating the DocLang command to support dynamically registered events.

on_tooltip

Called after the tooltip’s visibility state changes.

on_pre_tooltip

Called before the tooltip’s visibility state changes.

tooltip_text: StringProperty❖

Text content displayed inside the tooltip.

Default value❖
""
tooltip_markup: BooleanProperty❖

Whether tooltip_text should be interpreted as markup.

Default value❖
False
tooltip_side: OptionProperty❖

Preferred placement side for the tooltip relative to the widget.

TooltipManager resolves this preference and selects the final side based on available screen space.

Options

This attribute accepts only the following options:

"auto"
"cursor"
"left"
"top"
"right"
"bottom"
Default value❖
None
tooltip_offset: NumericProperty❖

Additional offset (in pixels) applied between the tooltip and its anchor position (widget or cursor).

Default value❖
None
tooltip_template: ObjectProperty❖

Custom widget class or instance used to render the tooltip.

Default value❖
None
tooltip_interactive: BooleanProperty❖

Enable interactive tooltip instead of auto‑hiding hover hints.

Warning

Tooltip interaction is only partially implemented.

The "cursor" tooltip side is partially supported, and "auto" may select "cursor" internally, resulting in same incomplete behavior.

Default value❖
None
on_tooltip(show: bool) → None❖

Called after the tooltip’s visibility state changes.

Parameters

Name

Description

state

True when the tooltip becomes visible, and False otherwise.

on_pre_tooltip(show: bool) → None❖

Called before the tooltip’s visibility state changes.

Parameters

Name

Description

state

True when the tooltip is about to be shown, and False otherwise.