Tooltip Spring Follow
A tooltip that trails the cursor on a spring and tilts with its velocity, like a tag swinging from the pointer.
tooltipcursorfollowspringvelocity
Installation
Run the shadcn CLI in a project with Tailwind CSS. The component lands in components/pixelpapa/tooltip-spring-follow.tsx.
$pnpm dlx shadcn@latest add "https://pixelpapa.com/r/tooltip-spring-follow.json"Manual install+
1. Install the dependencies.
$pnpm add motion2. Copy the code from the Code tab above into your project. It imports the cn helper from @/lib/utils, which every shadcn project already has.
Build it with AI
Prefer to let an agent do the wiring? Copy this prompt, describe where the component should go, and paste.
AI prompt
Paste into Claude, Cursor, v0 or Lovable
Add the "Tooltip Spring Follow" component from PixelPapa UI to this project. What it is: A tooltip that trails the cursor on a spring and tilts with its velocity, like a tag swinging from the pointer. Category: Tooltips & Popovers. Depends on: motion. 1. Install it with the shadcn CLI: npx shadcn@latest add "https://pixelpapa.com/r/tooltip-spring-follow.json" (If the CLI is unavailable, fetch that URL, write files[0].content to components/pixelpapa/tooltip-spring-follow.tsx and install the listed dependencies.) 2. Import it from "@/components/pixelpapa/tooltip-spring-follow" and place it where I describe below. 3. Keep its animation timings and accessibility attributes. Replace the demo copy and data with content that fits my product, and use my existing theme tokens (bg-background, text-foreground, bg-primary, border-border) rather than hard-coded colours. Where to use it: <describe the page and position here>
More tooltips & popovers
- Hover Card Link PreviewInline links that open a hover card with a drawn miniature of the destination page, which slowly scrolls while you read the summary.
- Popover Color Picker MiniA compact colour popover with a draggable saturation field, hue slider, swatches and hex input that springs out of its swatch trigger.
- Popover Share MenuA share popover with a public-link switch, a copy button that flips to a confirmed state with a sweep across the URL, and quick share targets.
- Tooltip Rich CardA toolbar whose rich tooltip (title, body, shortcut keys) glides from button to button instead of closing and reopening.