Animated Tooltip

An accessible, spring-animated tooltip with a customizable pointing arrow. Background, text, and arrow colours are independently configurable, and it follows WAI-ARIA guidance — hover/focus triggers, role="tooltip", aria-describedby, and Escape to dismiss.

UniqueUI CLI

npx uniqueui add animated-tooltip

shadcn CLI

npx shadcn@latest add https://uniqueui-platform.vercel.app/r/animated-tooltip.json -y

shadcn path expects @/lib/utils (run shadcn init first). Same source file is installed to components/ui/.

Preview

Link trigger

Usage

"use client";
import { AnimatedTooltip } from "@/components/ui/animated-tooltip";

export default function Example() {
  return (
    <AnimatedTooltip content="Copy to clipboard" side="top">
      <button className="rounded-md bg-neutral-800 px-4 py-2 text-sm text-white">
        Copy
      </button>
    </AnimatedTooltip>
  );
}

Props

PropTypeDescription
childrenReact.ReactElementThe trigger element. Must be a single focusable React element (e.g. a button or link).
contentReact.ReactNodeContent rendered inside the tooltip bubble.
side"top" | "bottom" | "left" | "right"Which side of the trigger the tooltip appears on.
align"start" | "center" | "end"Alignment along the trigger's edge.
backgroundstringBackground colour of the tooltip bubble.
colorstringText colour inside the tooltip.
arrowColorstringArrow fill colour. Defaults to `background` so it always matches.
arrowbooleanWhether to render the pointing arrow.
arrowSizenumberArrow edge length in px.
offsetnumberGap between the trigger and the tooltip in px.
delaynumberDelay before the tooltip appears, in ms.
disabledbooleanDisable the tooltip entirely (the trigger still renders).
classNamestringExtra Tailwind classes merged onto the tooltip bubble.