For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
0
Sponsor

Tooltip

A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.

import { Button } from "@/components/button/button";
import {
  Tooltip,
  TooltipContent,
  TooltipTrigger,
} from "@/components/tooltip/tooltip";

Installation

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

Usage

import {
  Tooltip,
  TooltipContent,
  TooltipTrigger,
} from "@/components/ui/tooltip/tooltip";
<Tooltip>
  <TooltipTrigger>Hover</TooltipTrigger>
  <TooltipContent>
    <p>Add to library</p>
  </TooltipContent>
</Tooltip>

Composition

Use the following composition to build a Tooltip:

Tooltip
├── TooltipTrigger
└── TooltipContent

Examples

Side

Use the side prop on TooltipContent to position the tooltip.

import { Button } from "@/components/button/button";
import {
  Tooltip,
  TooltipContent,
  TooltipTrigger,
} from "@/components/tooltip/tooltip";

RTL

To enable right-to-left support, see the RTL guide.

"use client";

import { useTranslation } from "@/components/language-selector";
import type { Translations } from "@/components/language-selector";
import { Button } from "@/components/button/button";
import {

API Reference

See the Base UI documentation for the full API.