Skip to content

Tooltip

Show a short explanation on hover or keyboard focus.

Demos

Size

Usage

vue
<script setup lang="ts">
import { Accordion } from '~/components/ui/accordion'

const items = [
  { value: 'source', label: 'Do I own the source?', content: 'Yes. Copy and adapt the files.' },
]
</script>

<template>
  <Accordion :items="items" />
</template>

Installation

Complete the shared installation. Copy Tooltip.vue and index.ts into app/components/ui/tooltip/.

API

Variants and defaults

PropValuesDefault
sizexs, sm, md, lg, xlsm

Props

PropTypeDefaultDescription
direction"top" | "bottom" | "left" | "right""top"Which side the tooltip appears on.
delayDurationnumber300Delay in ms before the tooltip shows on hover.
closeDelaynumber0Delay in ms before the tooltip hides after hover ends.
disabledbooleanfalsePrevent the tooltip from showing.
arrowbooleanfalseShow an arrow pointing to the trigger.
teleportstring | false"body"Teleport target.
transitionstring | false"akaza-tooltip"Named Vue transition.
uiTooltipUi—CSS class overrides.

Slots

SlotScoped propsDescription
trigger{ isOpen, triggerProps }The element that triggers the tooltip.
content{ close }The tooltip popup content.

Keyboard

KeyBehavior
Tab / Shift + TabFocusing trigger or its child opens tooltip; leaving closes it.
EscapeCloses topmost tooltip and restores trigger focus.

Tooltip never requires pointer hover. Apply triggerProps to interactive trigger so aria-describedby reaches actual focus target.