Skip to main content

Example

Basic tooltip example

Basic tooltip with a button as a trigger.

NeoTooltip(
  label: "I'm a helpful tooltip",
  child: NeoButton(
    variant: NeoButtonVariant.outlined,
    label: "Hover me",
    onPressed: () {},
  ),
),

Properties

Required

label
String
required
The text label to display in the tooltip.
child
Widget
required
The widget that triggers the tooltip on .

Layout

position
NeoTooltipPosition
default:"NeoTooltipPosition.top"
The position where the tooltip appears relative to the child widget.

Behavior

delay
Duration
default:"Duration(seconds: 1)"
The delay before showing the tooltip on hover. Does not affect long press behavior on mobile.

Enums

NeoTooltipPosition

Position where the tooltip appears relative to the child widget.
  • top: Tooltip appears above the child
  • right: Tooltip appears to the right of the child
  • bottom: Tooltip appears below the child
  • left: Tooltip appears to the left of the child

Best Practices

  • Accessibility: Tooltips are essential for icon-only buttons and helpful for providing additional context.

Integration Notes

  • Interaction Methods:
    • Desktop: Hover to show tooltip after the specified delay
    • Mobile: Long press to show tooltip immediately
  • Dismissal: Tooltips automatically hide when:
    • Mouse leaves the child area (desktop)
    • User taps outside the tooltip (mobile, after long press)
    • User performs other interactions
I