Tooltip

A tooltip displays a description of an element on hover or focus.

<Tooltip>
  <Button variant="default">Hover me</Button>
  <TooltipContent>Add to library</TooltipContent>
</Tooltip>

Installation

npx shadcn@latest add @dotui/tooltip

Usage

Use tooltips to provide contextual information about an element when it receives focus or the user hovers over it.

import { Button } from "@/components/ui/button";
import { Tooltip, TooltipContent } from "@/components/ui/tooltip";
<Tooltip>
	<Button>Hover me</Button>
	<TooltipContent>Tooltip content</TooltipContent>
</Tooltip>

Playground

Use the controls below to experiment with different tooltip props and see the live preview and code update.

placement
<Tooltip>
  <Button>Hover me</Button>
  <TooltipContent placement="top">Tooltip content</TooltipContent>
</Tooltip>

Examples

API Reference

Tooltip

TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip relative to the trigger.

PropType
boolean
number
number
"focus" | "hover"
boolean

TooltipContent

A tooltip displays a description of an element on hover or focus.

PropType
boolean
Element
number
ReactNode | function
boolean
boolean
Placement
DOMRenderFunction<"div", TooltipRenderProps>
RefObject<Element | null>

Last updated on 5/22/2026