Skip to content
Get started
Menu
Get started

Tooltip

PaymentTooltip adds a one-line, non-interactive hint to a control or a short value: the full date behind “2 days ago”, the name of an icon button. It opens on tap as well as on long press, hover and keyboard focus. It is the theme’s ink color with the surface color for text, the strongest contrast the theme has.

Tooltip opened by tapping the relative payment date to reveal the full date and time.Tooltip opened by tapping the relative payment date to reveal the full date and time.
Tooltip tap
Payment time tooltip beside relative date text, plus explanatory hint examples.Payment time tooltip beside relative date text, plus explanatory hint examples.
Tooltip
Payment time tooltip beside relative date text, plus explanatory hint examples at 200 percent text.
200% text
example/lib/screens/gallery_feedback.dart
PaymentTooltip(
placement: PaymentTooltipPlacement.top,
message: 'Paid on 29 Oct 2026, 14:05',
child: Text('2d ago'),
);

An interactive trigger, such as an info button, uses trigger. The button’s own press toggles the hint, because the button wins the tap:

example/lib/screens/steps/fees_step.dart
PaymentTooltip(
message: s.feesTooltip,
trigger: (toggle, focusNode) => PaymentIconButton(
icon: Icons.info_outline,
tooltip: s.feesInfo,
focusNode: focusNode,
onPressed: toggle,
),
);

Variants: label, description; twelve placements.

  • A tap on a non-interactive child (text, an icon, a disabled control) toggles the hint. A second tap, a tap outside and Escape close it.
  • A child with its own tap action wins the tap, so wrap an interactive control with trigger instead of child. The builder receives toggle and a focusNode. Pass toggle to the button’s onPressed and the focus node to the button. The kit hides the button’s own Material tooltip and keeps its name for screen readers.
  • An info icon never has a no-op onPressed: it toggles its hint or opens a sheet.
  • Pass exactly one of child and trigger.

A tooltip holds one line. An explanation that needs more, such as a promotion’s “Why this?” / “Kenapa ini?”, opens a sheet with a title, the text and one primary Close. See Promotions.

A tooltip is easy to miss on a phone: nothing shows that it is there. It may only repeat or name something already on screen.

  • Never put a fee, a requirement, a deadline or an error only in a tooltip. Show it on the page, in an info row or a notice banner.
  • Do not put a tooltip on something people tap for another reason and expect them to discover it.

The twelve placements are top, topStart, topEnd, bottom, bottomStart, bottomEnd, start, startTop, startBottom, end, endTop and endBottom. Start and end follow direction. A bubble flips when the opposite side fits, then shifts inside an 8 dp margin. Default placement is bottom.

Label names an icon-only trigger; description adds its semantic tooltip. The bubble is never interactive or focusable and needs an Overlay. A tap opens it at once, and a second tap closes it. Hover waits 500 ms by default; keyboard focus opens immediately. Escape, blur, exit, an outside tap and another tooltip close it. A hint opened by long press closes 1.5 seconds after release. Never put a fee, requirement or error only here.

Situation Variant / composition Payment example
Fee policy explanation description Attach to a focusable 48 dp trigger; use label only when replacing the trigger name.

Use a focus view for interactive help content.

The hint opens on tap, long press, hover or keyboard focus. Longer explanations belong in a sheet.

Do: Attach to a focusable 48 dp trigger; use label only when replacing the trigger name.

Don’t: Put links or buttons inside tooltip content, or give an info icon a no-op onPressed.

  • One short sentence or a label, in sentence case, without end punctuation for labels.
  • Do not repeat the visible text word for word. Add the detail it leaves out, such as the exact time.
  • The message is also the control’s tooltip in the semantics tree, so screen readers read it with the control.
  • Keyboard focus opens it. Do not rely on a tooltip for anything a keyboard user needs.
Example fees screen with synthetic dataExample fees screen with synthetic data
Example: fees

PaymentTooltip

class PaymentTooltip extends StatefulWidget · lib/src/controls/controls.dart

A one-line, noninteractive hint (D49). It opens on tap, hover, long press or keyboard focus; a second tap, an outside tap, Escape, blur and exit close it. Screen readers get message through the trigger's semantics. Requires an Overlay.

Wrap text, an icon or a disabled control in child. For an interactive trigger such as an info PaymentIconButton, use trigger instead: the button's own press must toggle the hint, because it wins the tap.

Never put a fee, a requirement or an error only in a tooltip. An explanation longer than one line ("Why this?") opens a sheet instead.

ParameterTypeDefaultDescription
message:requiredString——
child:Widget?—A non-interactive trigger; a tap on it toggles the hint.
trigger:Widget Function(VoidCallback toggle, FocusNode focusNode)?—Builds an interactive trigger that toggles the hint, e.g. an info PaymentIconButton with onPressed: toggle (D49). Pass focusNode to the button so keyboard focus shows the hint too.
placement:PaymentTooltipPlacementPaymentTooltipPlacement.bottom—
type:PaymentTooltipTypePaymentTooltipType.description—
delay:Durationconst Duration(milliseconds: 500)—

PaymentTooltipPlacement

enum PaymentTooltipPlacement · lib/src/controls/controls.dart

Twelve placements; start and end follow the text direction.

ValueDescription
topAbove the trigger, centered.
topStartAbove the trigger, aligned to its start edge.
topEndAbove the trigger, aligned to its end edge.
bottomBelow the trigger, centered.
bottomStartBelow the trigger, aligned to its start edge.
bottomEndBelow the trigger, aligned to its end edge.
startOn the start side of the trigger (left in LTR), centered.
startTopOn the start side of the trigger (left in LTR), aligned to its top edge.
startBottomOn the start side of the trigger (left in LTR), aligned to its bottom edge.
endOn the end side of the trigger (right in LTR), centered.
endTopOn the end side of the trigger (right in LTR), aligned to its top edge.
endBottomOn the end side of the trigger (right in LTR), aligned to its bottom edge.

PaymentTooltipType

enum PaymentTooltipType · lib/src/controls/controls.dart

Whether the message names the trigger or adds detail.

ValueDescription
labelBecomes the trigger's semantic label.
descriptionBecomes the trigger's semantic tooltip.