Docs menu

Tooltip

A little speech bubble that pops out of whatever it describes, with a bounce, two tiny puffs and a glint.

Installation

❯ npx shadcn@latest add https://yan.moe/r/tooltip.json

Usage

tsx
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"
tsx
<Tooltip>
  <TooltipTrigger>Hover me</TooltipTrigger>
  <TooltipContent>ぽんっ!</TooltipContent>
</Tooltip>

Each Tooltip brings its own provider. To share one delay across many tooltips, wrap them in TooltipProvider yourself.

Accessibility

  • Built on Radix Tooltip: it opens on hover and on keyboard focus, and closes with Escape.
  • A tooltip is a hint, not a label. Icon-only buttons still need aria-label.
  • With prefers-reduced-motion: reduce, the bubble appears without the bounce or the puffs.

API

PropTypeDefault
intensity

Set on TooltipContent. kawaii: bounce, puffs and a glint. subtle: fade in. off: just appear.

"kawaii" | "subtle" | "off""kawaii"
side

Set on TooltipContent. Preferred side.

"top" | "right" | "bottom" | "left""top"
sideOffset

Set on TooltipContent. Gap between trigger and bubble, in px.

number8
delayDuration

Set on Tooltip or TooltipProvider. Hover delay in ms.

number150