Skip to content

Tooltip ​

A popup that displays informational text when hovering, clicking, focusing, or right-clicking on an element.

Basic ​

vue
<VxTooltip content="This is a tooltip">
  <VxButton>Hover me</VxButton>
</VxTooltip>

Theme ​

Dark (default) and light themes.

vue
<VxTooltip content="Dark theme" theme="dark">...</VxTooltip>
<VxTooltip content="Light theme" theme="light">...</VxTooltip>

Custom Color ​

Set any background and text color.

vue
<VxTooltip content="Blue" color="#3b82f6" text-color="#fff" arrow>
  <VxButton>Blue</VxButton>
</VxTooltip>

<VxTooltip content="Green" color="#22c55e" text-color="#fff" arrow>
  <VxButton>Green</VxButton>
</VxTooltip>

<VxTooltip content="Gradient" color="linear-gradient(135deg, #667eea, #764ba2)" text-color="#fff">
  <VxButton>Gradient</VxButton>
</VxTooltip>

Arrow ​

Show a directional arrow pointing to the trigger.

vue
<VxTooltip content="With arrow" arrow>
  <VxButton>Hover me</VxButton>
</VxTooltip>

<VxTooltip content="Light arrow" arrow theme="light">
  <VxButton>Hover me</VxButton>
</VxTooltip>

Trigger ​

Supports hover (default), click, focus, and contextmenu triggers.

vue
<VxTooltip content="Hover" trigger="hover">...</VxTooltip>
<VxTooltip content="Click" trigger="click">...</VxTooltip>
<VxTooltip content="Focus" trigger="focus">...</VxTooltip>
<VxTooltip content="Right-click" trigger="contextmenu">...</VxTooltip>

v-model ​

Programmatically control tooltip visibility with v-model.

vue
<script setup>
const visible = ref(false)
</script>

<VxTooltip v-model="visible" content="Controlled tooltip">
  <VxButton>Target</VxButton>
</VxTooltip>

<VxButton @click="visible = !visible">Toggle</VxButton>

Before Show Hook ​

Run an async validation before the tooltip appears. Return false or throw to block it.

vue
<script setup>
async function check() {
  const ok = await verifyPermission()
  return ok
}
</script>

<VxTooltip content="Allowed!" :before-show="check">
  <VxButton>Guarded</VxButton>
</VxTooltip>

Auto Close ​

Automatically dismiss the tooltip after a timeout (in ms).

vue
<VxTooltip content="Disappears in 2s" :auto-close="2000">
  <VxButton>Auto Close</VxButton>
</VxTooltip>

Copyable ​

Click the tooltip to copy its text content to clipboard.

vue
<VxTooltip content="npm install veloxui" copyable @copy="onCopy">
  <code>npm install veloxui</code>
</VxTooltip>

Loading ​

Show a spinner inside the tooltip.

vue
<VxTooltip loading>
  <VxButton>Loading</VxButton>
</VxTooltip>

Persistent (v-show) ​

Keep the tooltip DOM node alive when hidden. Useful for performance when the tooltip is frequently toggled.

vue
<VxTooltip content="I stay in the DOM" persistent>
  <VxButton>Persistent</VxButton>
</VxTooltip>

Teleport ​

Teleport the tooltip to body to escape overflow: hidden containers.

vue
<div style="overflow: hidden;">
  <VxTooltip content="I escape!" teleport-to="body">
    <VxButton>Teleported</VxButton>
  </VxTooltip>
</div>

Content Slot ​

Use the #content slot for rich tooltip content.

vue
<VxTooltip theme="light" arrow>
  <template #content>
    <div>
      <strong>Pro tip</strong>
      <p>Rich content in tooltips</p>
    </div>
  </template>
  <VxButton>Rich Content</VxButton>
</VxTooltip>

Raw HTML ​

Render HTML strings with the raw prop.

vue
<VxTooltip content="<strong>bold</strong> and <em>italic</em>" raw>
  <VxButton>Raw HTML</VxButton>
</VxTooltip>

Always Visible ​

vue
<VxTooltip content="I'm always here" always>
  <VxButton>Always Visible</VxButton>
</VxTooltip>

Delay ​

Customize show and hide delays in milliseconds.

vue
<VxTooltip content="Slow" :show-delay="500">...</VxTooltip>
<VxTooltip content="Instant" :show-delay="0" :hide-delay="0">...</VxTooltip>

Non-Enterable ​

Tooltip hides immediately when the cursor leaves the trigger.

vue
<VxTooltip content="Enterable" :enterable="true">...</VxTooltip>
<VxTooltip content="Not enterable" :enterable="false">...</VxTooltip>

Disabled ​

vue
<VxTooltip content="Hidden" disabled>
  <VxButton disabled>Disabled</VxButton>
</VxTooltip>

On Various Elements ​

vue
<VxTooltip content="Badge"><VxBadge value="3" /></VxTooltip>
<VxTooltip content="Avatar"><VxAvatar name="John" /></VxTooltip>
<VxTooltip content="Help"><span class="help">What?</span></VxTooltip>

API ​

Props ​

PropTypeDefaultDescription
v-modelboolean—Programmatic visibility control
contentstring''Tooltip text content
trigger'hover' | 'click' | 'focus' | 'contextmenu''hover'How to trigger the tooltip
theme'dark' | 'light''dark'Visual theme
colorstring''Custom background color (CSS value, supports gradients)
textColorstring''Custom text color
arrowbooleanfalseShow directional arrow
disabledbooleanfalseDisable the tooltip
showDelaynumber100Delay before showing (ms)
hideDelaynumber100Delay before hiding (ms)
autoClosenumber0Auto-dismiss after N ms (0 = disabled)
offsetnumber8Distance from trigger in px
maxWidthstring | number280Maximum tooltip width
enterablebooleantrueKeep tooltip open when cursor enters it
rawbooleanfalseRender content as raw HTML
alwaysbooleanfalseKeep tooltip permanently visible
copyablebooleanfalseClick tooltip to copy text to clipboard
loadingbooleanfalseShow loading spinner instead of content
persistentbooleanfalseKeep DOM alive when hidden (v-show vs v-if)
beforeShow() => boolean | Promise<boolean>—Async guard; return false or throw to block
teleportTostring''Teleport target (e.g. 'body') to escape overflow
transitionstring'vx-tooltip'Custom transition name

Events ​

EventPayloadDescription
update:modelValuebooleanv-model sync
show—Tooltip became visible
hide—Tooltip was hidden
copystringText was copied to clipboard (when copyable)

Slots ​

SlotDescription
defaultTrigger element
contentCustom tooltip content (replaces content prop)

Exposed Methods ​

MethodDescription
show()Programmatically show the tooltip
hide()Programmatically hide the tooltip
updatePosition()Recalculate position