Skip to content
shadcn.io is not affiliated with official shadcn/ui

Shadcn Tooltip for React and Tailwind

Display information on hover or focus.

Installation

bunx --bun shadcn@latest add https://kit.dev/r/tooltip.json

Anatomy

Tooltip
├── TooltipTrigger
└── TooltipContent

Usage

import { 
  Tooltip, 
  TooltipContent, 
  TooltipTrigger 
} from "@/components/ui/tooltip";
<Tooltip>
  <TooltipTrigger>Hover me</TooltipTrigger>
  <TooltipContent>
    {/* Content */}
  </TooltipContent>
</Tooltip>

Tooltip vs Toggle Tooltip

You're viewing Tooltip—a label that shows on hover or focus. Use it when the content is supplementary and non-essential, and you're okay with touch users not having access.

Use Tooltip when

  • The trigger has its own purpose and the popup is supplementary.
  • The content is non-essential—nice-to-have clarity for sighted mouse/keyboard users.
  • You're okay with touch users not seeing it—tooltips only open on hover/focus, not on tap.
  • The content is short and non-interactive (no links or buttons inside).

Tooltip behavior

  • Hover or focus only — Opens on hover/focus; touch users cannot access it.
  • Non-interactive — Keep content short with no links or buttons.
  • Supplementary — Best for nice-to-have information, not critical content.

Consider Toggle Tooltip when

  • The trigger's primary purpose is to reveal the content.
  • The content is essential and should be accessible to touch users and screen readers.
  • You need click-to-open so everyone can access it.
  • The content may be interactive (links, buttons).

Positioning

Use the positioning prop to change the position of the tooltip.

Examples

With Keyboard Shortcut

Disabled Button

Show a tooltip on a disabled button by wrapping it with a span.

API Reference

Tooltip

Root component that wraps the tooltip. Manages open state and positioning.

PropTypeDefault
positioningPositioningOptions{ placement: "top" }
openDelaynumber0
closeDelaynumber100
lazyMountbooleantrue
unmountOnExitbooleantrue
openboolean-
defaultOpenboolean-
onOpenChange(details: OpenChangeDetails) => void-
disabledboolean-
interactivebooleanfalse
closeOnClickbooleantrue
closeOnEscapebooleantrue
closeOnPointerDownbooleantrue
closeOnScrollbooleantrue

TooltipTrigger

Element that shows the tooltip on hover or focus. Button by default; use asChild for custom elements.

PropTypeDefault
asChildboolean-

TooltipContent

Tooltip content shown in a popover on hover or focus.

PropTypeDefault
classNamestring-
asChildboolean-

TooltipArrow

Optional arrow pointing to the trigger. Place inside TooltipContent.

PropTypeDefault
asChildboolean-
AttributeDefault
--arrow-backgroundvar(--foreground)
--arrow-sizecalc(1.5 * var(--spacing))

For a complete list of props, see the Ark UI documentation.