Overlays

Tooltip

A short label on hover or keyboard focus. Fast when you need it, silent when you don’t.

Copy link Search ⌘K

Installation #

With the Nuxt module, every component is auto-imported — there is nothing to add. In a plain Vue project, import what you use:

Copy
import { JTooltip } from '@juxtui/ui'

Usage #

Copy
<JTooltip content="Copy link">
  <JButton variant="ghost" icon aria-label="Copy link"><LinkIcon /></JButton>
</JTooltip>

After one tooltip has been shown, neighbouring tooltips open instantly for a moment — scanning a toolbar never means waiting at each icon.

Tooltips never hold essential information. If it matters, put it on the page.

Variants & examples #

Placement#

On the topOn the rightOn the bottomOn the left
Copy
<script setup lang="ts">
const sides = ['top', 'right', 'bottom', 'left'] as const
</script>

<template>
  <JTooltip v-for="side in sides" :key="side" :content="`On the ${side}`" :side="side">
    <JButton variant="outline" size="sm">{{ side }}</JButton>
  </JTooltip>
</template>

In a toolbar#

Move across the buttons: only the first tooltip waits.

API #

Props

PropTypeDefault Description
contentstring—Tooltip text. Use the content slot for richer content.
side'top' | 'right' | 'bottom' | 'left''top'Preferred side. Flips when there isn’t room.
align'start' | 'center' | 'end''center'Alignment along the side.
delaynumber450Hover delay in ms. Keyboard focus shows it immediately.
disabledbooleanfalseTurn the tooltip off.

Slots

SlotProps Description
default—The trigger element.
content—Custom tooltip content.

Accessibility #

  • The trigger is described with aria-describedby, pointing at a node that always exists — announcements don’t depend on timing.
  • The tooltip can be hovered, so it doesn’t vanish on the way to reading it (WCAG 1.4.13).
  • Clicking the trigger hides the tooltip until the pointer leaves.
  • Touch devices don’t show tooltips on tap; don’t rely on them for mobile.

Keyboard #

Key Action
TabFocusing the trigger with the keyboard shows the tooltip.
EscHides the tooltip.