Easy Shadcn
Components

Tooltip

Tooltip collapses shadcn's six nested Tooltip parts (TooltipProvider / Tooltip / TooltipTrigger / TooltipContent and the portal + positioner inside) into a single drop-anywhere component: wrap any element and pass the content.

Installation

With the @easy-shadcn namespace configured:

pnpm dlx shadcn@latest add @easy-shadcn/tooltip

Or install via the full URL (zero configuration):

pnpm dlx shadcn@latest add https://easy-shadcn.vercel.app/r/tooltip.json

Props

PropTypeDefaultDescription
childrenReactElement-The trigger. Must be a single element — it becomes the trigger itself.
contentReactNode-The tooltip body.
side"top" | "bottom" | "left" | "right" | "inline-start" | "inline-end""top"Which side of the trigger the tooltip is placed on.
sideOffsetnumber4Gap between the trigger and the tooltip.
align"start" | "center" | "end""center"Alignment along the chosen side.
alignOffsetnumber0Offset along the alignment axis.
openboolean-Controlled open state.
defaultOpenbooleanfalseInitial open state (uncontrolled).
onOpenChange(open: boolean, eventDetails) => void-Called when the open state changes.
disabledbooleanfalseDisables the tooltip — it never opens.
delaynumber0Delay before opening, in ms.
closeDelaynumber0Delay before closing, in ms.
contentClassNamestring-Class override for the tooltip popup.

Notes

  • children must be a single element that forwards props and a ref (a DOM tag like <button>, or a component built with forwardRef / Base UI's render). It becomes the trigger directly — no extra wrapper element is added, so there is no nested-button problem.
  • The component wraps its own TooltipProvider, so a single <Tooltip> works without any app-root setup. Because each instance carries its own provider, an app-root TooltipProvider has no effect on these tooltips — for shared hover grouping (adjacent tooltips opening instantly), compose the components/ui/tooltip primitives under one shared TooltipProvider instead.
  • For cursor-following tooltips, hoverable rich popups, or one tooltip shared by multiple triggers, compose the components/ui/tooltip primitives directly instead.

On this page