Drift Tooltip

A tooltip that floats into place and drifts sideways after the cursor, like it's carried by a current.

no dependenciesMIT · free
BoldItalicAdd a linkInsert image
Drifts after your cursor across the whole button

Installation

npx shadcn@latest add https://ombakui.com/r/drift-tooltip.json

Usage

import { DriftTooltip } from "@/components/drift-tooltip";

<DriftTooltip content="Bold">
  <button aria-label="Bold">B</button>
</DriftTooltip>

Props

PropTypeDefaultDescription
children*ReactElement<Record<string, unknown>>–The element that gets the tooltip. Must accept ref-less event props (a button, link, span…).
content*ReactNode–Tooltip text or content.
side"top" | "bottom""top"Above or below the element.
delaynumber120Delay before showing, in ms.
classNamestring–