Skip to main content

Tooltip

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

On this page
Props
<Tooltip>
  <Button>Hover me</Button>
  <TooltipContent>Tooltip content</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>

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
RefObject<Element | null>

Last updated on 6/16/2026