Tooltip

A floating, intelligent label that provides additional context or information. It can be triggered by hovering or clicking, includes a visual arrow, and avoids edge collisions.

When To Use

  • The Tooltip doesn't support complex text or operations. The tip is shown on mouse enter and is hidden on mouse leave.
  • To provide an explanation for a button/text/operation. It's often used instead of the HTML title attribute to explain button/text/operation.

Wrapper Component

You can wrap elements with the Tooltip component and configure its content and position props.

Data Attributes (No Wrapper)

Because Tooltip creates a global listener, you do not need to import or wrap elements. Just add the data-tooltip attribute to any HTML element! This is perfect for inline text or dynamic content.

This is a paragraph with some inline tooltipable text that works without any wrappers.

Rich Content & Clicks

Tooltips can also be triggered on click instead of hover using trigger="click". You can also pass complex HTML content and titles using the slots (or direct props).

Properties Approach

Instead of using slots for complex tooltips, you can directly pass the title, description, and icon via component props for a cleaner syntax.

API Reference

Property
Description
Type
Default

content

Main text content to display string '-'

title

Tooltip string '-'

description

Optional muted description text below the content string '-'

icon

Optional IconName to render alongside the text IconName '-'

position

Preferred placement around the trigger 'top' | 'bottom' | 'left' | 'right' 'top'

trigger

Event that triggers the tooltip to appear 'hover' | 'click' 'hover'