Tooltip
A floating label that appears when the user hovers or focuses an element.
Tooltip shows supplemental text on hover or focus without trapping focus. It suits icon buttons and truncated text.
Anatomy
#trigger: Element the tooltip anchors to.#content: Tooltip popup text or content.
Usage
Examples
Custom delay
Use delay props to tune how quickly the tooltip appears and disappears.
@layer akaza-reset;
@import "tailwindcss";
@import "akaza-ui/dist/akaza-ui.css";
Positioned to the right
Use direction to choose the preferred side for the tooltip.
<template>
<Avatar
src="/avatar.jpg"
alt="Jane Doe"
text="JD"
:delay-ms="300"
/>
</template>
With arrow
Use arrow when the tooltip needs a visual pointer back to the trigger.
<Button
:ui="{
root: 'rounded-md bg-black px-3 py-2 text-white',
spinner: 'size-4 animate-spin',
}"
>
Save
</Button>
Disabled tooltip
Use disabled when the trigger should render but the tooltip should not open.
<template>
<Button
as="a"
href="/docs"
>
Read the docs
</Button>
</template>
Controlled open state
Use v-model when external state should control tooltip visibility.
<template>
<Button
disabled
focusable-when-disabled
>
Restricted
</Button>
</template>
Hover, SSR, and layers
The transparent hit area bridges the gap between the trigger and tooltip content. Escape ignores closeDelay and closes the tooltip. Delay props remain reactive after mount.
Open tooltips do not install browser listeners during SSR. Client tooltips participate in the shared popup layer order and modal ownership. Bind the slot's triggerProps to the actual focusable trigger so aria-describedby reaches the correct element.
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
direction | "top" | "bottom" | "left" | "right" | "top" | Which side the tooltip appears on. |
delayDuration | number | 300 | Delay in ms before the tooltip shows on hover. |
closeDelay | number | 0 | Delay in ms before the tooltip hides after hover ends. |
disabled | boolean | false | Prevent the tooltip from showing. |
arrow | boolean | false | Show an arrow pointing to the trigger. |
teleport | string | false | "body" | Teleport target. |
transition | string | false | "akaza-tooltip" | Named Vue transition. |
ui | TooltipUi | — | CSS class overrides. |
Slots
| Slot | Scoped props | Description |
|---|---|---|
trigger | { isOpen, triggerProps } | The element that triggers the tooltip. |
content | { close } | The tooltip popup content. |
UI Options
| Key | Description |
|---|---|
root | The outer wrapper element. |
trigger | The trigger element wrapper. |
content | The tooltip popup element. |
arrow | The optional arrow element. |
Styling Hooks
| UI key | CSS class | Data attrs |
|---|---|---|
root | akaza-tooltip-root | — |
trigger | akaza-tooltip-trigger | data-akaza-state |
content | akaza-tooltip-content | data-akaza-state, data-akaza-side |
arrow | akaza-tooltip-arrow | — |
Positioning Variables
Positioning leaves CSS transforms available for consumer styles and enter/leave transitions. The preferred direction falls back to another side when space is insufficient.
| Variable | Meaning |
|---|---|
--akaza-tooltip-anchor-width | Anchor width in pixels. |
--akaza-tooltip-anchor-height | Anchor height in pixels. |
--akaza-tooltip-available-width | Viewport width after collision padding. |
--akaza-tooltip-available-height | Viewport height after collision padding. |
--akaza-tooltip-transform-origin | Origin matching the resolved side and alignment. |
Keyboard
| Key | Behavior |
|---|---|
Tab / Shift + Tab | Focusing trigger or its child opens tooltip; leaving closes it. |
Escape | Closes topmost tooltip and restores trigger focus. |
Tooltip never requires pointer hover. Apply triggerProps to interactive trigger so aria-describedby reaches actual focus target.