Tooltip

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

<Tooltip>
  <Button>
    <SquarePenIcon />
  </Button>
  <TooltipContent>
    Create new issue <Kbd>C</Kbd>
  </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>

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"

TooltipContent

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

PropType
boolean
RefObject<Element | null>
boolean
boolean
Element
Placement
number
ReactNode | function

Last updated on 1/13/2026

Built with passion by @mehdibha.