Ship faster with goilerplate templUI Pro

Tooltip

Small pop-up that appears on hover. Powered by Popover with Floating UI.

Source Tailwind CSS JavaScript

Add to cart

Installation

templui add tooltip

Load the script once in your layout:

<head>
  @tooltip.Script()
</head>

Examples

Positions

Tooltip on top
Tooltip on right
Tooltip on bottom
Tooltip on left

API Reference

Required parameter
Hover for description

Tooltip

Root wrapper component for tooltip functionality.

Name Type Default
ID

Unique identifier for the tooltip wrapper.

string
-
Class

Additional CSS classes to apply to the tooltip wrapper.

string
-
Attributes

Additional HTML attributes to apply to the tooltip wrapper.

templ.Attributes
-

Trigger

Element that triggers the tooltip on hover.

Name Type Default
ID

Unique identifier for the trigger element.

string
-
Class

Additional CSS classes to apply to the trigger.

string
-
Attributes

Additional HTML attributes to apply to the trigger element.

templ.Attributes
-

Content

Container for the tooltip content with positioning options.

Name Type Default
ID

Optional HTML id for the content element.

string
-
Class

Additional CSS classes to apply to the content. Default styling includes dark background.

string
-
Attributes

Additional HTML attributes to apply to the content element.

templ.Attributes
-
ShowArrow

Whether to show an arrow pointing to the trigger element.

bool
false
Position

Position of the tooltip relative to trigger. Options: 'top', 'right', 'bottom', 'left'.

Position
top
HoverDelay

Delay in milliseconds before showing the tooltip on hover.

int
0
HoverOutDelay

Delay in milliseconds before hiding the tooltip on hover out.

int
0