Skip to content

Tooltip

Tooltip shows a short hint on hover. It is built on top of Popover, defaulting to triggerEvent="hover".

Basic

Use the content prop for simple text, or the #popup slot for custom content.

Global config

Use HiConfigProvider to set default tooltip styles via tooltip.class:

vue
<template>
  <hi-config-provider :tooltip="{ class: 'bg-gray-800 text-white px-2 py-1 rounded text-sm' }">
    <hi-tooltip content="Hint">
      <button>Hover me</button>
    </hi-tooltip>
  </hi-config-provider>
</template>

Tooltip Props

NameTypeDefaultDescription
contentstring-Simple text content for the tooltip
classClassType-Class for the tooltip layer (merged with global tooltip.class)
placementPlacement"top"Position: bottom, top, left, right, auto, top-left, top-right, bottom-left, bottom-right, left-top, left-bottom, right-top, right-bottom
triggerEventTriggerEvent"hover"Trigger: click, mousedown, dblclick, hover, contextmenu, focus, touch
offsetnumber8Gap between tooltip and trigger (px)
disabledbooleanfalseWhether the tooltip is disabled
popupAsstring | Component"div"Tag or component for the tooltip layer
asstring"div"Root element tag of the trigger wrapper

Tooltip Slots

NameDescription
defaultTrigger element (wrapped content)
popupTooltip content; overrides content prop when provided