Tooltip

A tooltip that blooms from 70% and warms up its next appearance.

tooltip.tsx

Installation

1

Install the packages

npm install @prequelui/react motion

@prequelui/react reuses the primitive library your components already depend on.

2

Add the component

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/tooltip.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/tooltip.json

3

Turn on the motion

npx @prequelui/cli@latest animate tooltip

The CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.

Usage

Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.

tooltip.tsx
import {
  Tooltip,
  TooltipTrigger,
  TooltipContent,
  TooltipProvider,
} from "@/components/prequelui/tooltip";

export default function Demo() {
  return (
    <TooltipProvider delay={180}>
      <Tooltip>
        <TooltipTrigger>
          <button type="button">Hover me</button>
        </TooltipTrigger>
        <TooltipContent side="top">Saved just now</TooltipContent>
      </Tooltip>
    </TooltipProvider>
  );
}
import { Tooltip } from "@/components/prequelui/tooltip";

export function Variant() {
  return (
    <Tooltip tempo={1.2}>
      …
    </Tooltip>
  );
}

Animation

The tooltip blooms from 70% of its size with a six-pixel blur and comes to rest on a soft spring. Once a tooltip has been seen, the next one opens without the delay, so moving across a toolbar feels continuous.

  • Entry spring: 400 / 31 from scale 0.7, 6 px blur and a 6 px offset.
  • Exit: 130 ms on the leave curve, shorter than the entrance.
  • Warm-up window: 300 ms after a close, the delay is skipped.
  • Escape closes the current tooltip without moving focus.
  • Reduced motion removes scale, offset and blur.
spring 400 / 31scale 0.7blur 6 pxexit 130 ms

API Reference

Every part takes exactly the props of the Tooltip primitive. The animated surface adds only motion props, so the accessibility tree and keyboard behaviour stay the same.

TooltipProvider

PropTypeDefault
delaynumber180
closeDelaynumber80
warmUpnumber300

Tooltip

PropTypeDefault
openboolean—
defaultOpenbooleanfalse
onOpenChange(open: boolean) => void—
side"top" | "bottom" | "left" | "right""top"
sideOffsetnumber8
delaynumberprovider
closeDelaynumberprovider

TooltipContent

PropTypeDefault
side"top" | "bottom" | "left" | "right"inherited
sideOffsetnumberinherited
transitionTransitioncomponent spring or tween
exitTransitionTransition130 ms, leave curve
classNamestring—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026