---
title: Tooltip
description: A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
component: true
links:
doc: https://www.radix-ui.com/docs/primitives/components/tooltip
api: https://www.radix-ui.com/docs/primitives/components/tooltip#api-reference
source:
radix: true
shadcn: true
---
## Installation
CLI
Manual
```bash
npx shadcn-ui@latest add tooltip
```
Install the following dependencies:
```bash
npm install @radix-ui/react-tooltip
```
Copy and paste the following code into your project.
Update the import paths to match your project setup.
## Usage
```tsx
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
```
```tsx
Hover
Add to library
```
## Inline text
Use a dotted underline and a help cursor (`cursor-help`) for a term with a short definition. Hover over the term or press Tab to focus it.
By default, the tooltip opens above the term. The tooltip automatically flips below the term when there isn’t enough room above it in the viewport.
In Studio, apply `TOOLTIP_UNDERLINE_CLASS_NAME` from `@/components/ui/tooltip-styles` to the trigger. Keep information people need to make a decision visible on the page.