Components

Tooltip

Add tooltips to buttons and links.

UiTooltip is a generic tooltip wrapper for any trigger element. UiButtonTooltip and UiLinkTooltip wrap a button or link with a floating tooltip, adding button/link semantics on top.

Wrap any element

Use UiTooltip when the trigger isn't a plain button or link — its default slot is the trigger, and text sets the tooltip content.

<template>
  <UiTooltip text="Helpful hint" placement="bottom">
    <UiButton variant="outline" text="Hover me" />
  </UiTooltip>
</template>

Rich tooltip content

Use the #content slot instead of text for markup like kbd shortcuts or links.

<template>
  <UiTooltip placement="top">
    <UiButton variant="outline" icon>
      <template #icon>
        <UiIconMaterial icon-code="&#xe161;" />
      </template>
    </UiButton>
    <template #content>
      Save changes <kbd>Ctrl</kbd> + <kbd>S</kbd>
    </template>
  </UiTooltip>
</template>

Button with a tooltip

<template>
  <UiButtonTooltip variant="outline" icon tooltip-text="Add item">
    <template #icon>
      <UiIconMaterial icon-code="&#xe145;" />
    </template>
  </UiButtonTooltip>
</template>
<script setup lang="ts">
import { NuxtLink } from '#components'
</script>

<template>
  <UiLinkTooltip
    :as="NuxtLink"
    to="/docs"
    text="Docs"
    tooltip-text="Read the documentation"
    placement="bottom"
  />
</template>

UiTooltip props

PropTypeDefaultDescription
textstring | null—Plain-text tooltip content. Ignored when the #content slot is used.
placementFloatingPlacement'top'Tooltip position (top, bottom, left, right, and their -start/-end variants).
disabledbooleanfalseDisables the tooltip.
ariaIdstringgenerated with useId()Id of the popper content, referenced by the trigger's aria-describedby. The generated value is stable across server and client rendering.
customClassstring | string[] | Record<string, boolean> | null—Extra classes for the trigger wrapper element.

Slots: default is the trigger element; content renders rich tooltip content instead of text.

UiTooltip frees you from wrapping a trigger in UiButtonTooltip/UiLinkTooltip when it isn't a plain button or link — for example an avatar, an icon, or a custom control.

UiButtonTooltip props

Extends UiButton props, plus:

PropTypeDefaultDescription
tooltipTextstring—Tooltip content.
placementFloatingPlacement'top'Tooltip position (top, bottom, left, right, …).
ariaExpandedboolean—Forwarded aria-expanded.
ariaControlsstring—Forwarded aria-controls.

Emits: click (with the MouseEvent). Slots: #icon.

UiLinkTooltip props

Extends the base button props, plus:

PropTypeDefaultDescription
tostring | object—Router destination.
hrefstring—External URL.
asstring | object'a'Link component.
tooltipTextstring | null—Tooltip content.
placementFloatingPlacement'top'Tooltip position.

Slots: #icon.

CSS variables

Tooltips render at the end of <body>, outside the trigger's wrapper, so set these on :root. They apply to UiTooltip, UiButtonTooltip and UiLinkTooltip.

:root {
  --cffy-tooltip-bg-color: var(--cffy-primary-a10);
  --cffy-tooltip-color: var(--cffy-on-primary);
  --cffy-tooltip-radius: var(--cffy-radius-full);
}
VariableDefaultControls
--cffy-tooltip-bg-color / --cffy-tooltip-color--cffy-surface-tooltip / $whiteBackground and text
--cffy-tooltip-padding--cffy-space-8Padding
--cffy-tooltip-radius--cffy-radius-md, up to --cffy-shape-containerCorners
--cffy-tooltip-shadownoneShadow
--cffy-tooltip-font-size / --cffy-tooltip-font-weight0.6875rem / --cffy-fw-500Text
--cffy-tooltip-kbd-bg-color / --cffy-tooltip-kbd-color--cffy-surface-kbd / --cffy-on-background-inverseKeyboard keys inside the tooltip
Copyright © 2026