---
title: Tooltip
description: A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
link:
  doc: https://kobalte.dev/docs/core/components/tooltip
  api: https://kobalte.dev/docs/core/components/tooltip#api-reference
---

<ComponentPreview name="tooltip-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/tooltip-demo.tsx

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

<StepItem>Copy and paste the following code into your project:</StepItem>

  <ComponentSourceTabs>

    ```tsx title="components/ui/tooltip" file=<rootDir>/apps/docs/src/registry/ui/tooltip.tsx

    ```

    ```tsx title="components/ui/tooltip" file=<rootDir>/apps/unocss-playground/src/registry/ui/tooltip.tsx

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

### Usage

```tsx
import {
  Tooltip,
  TooltipContent,
  TooltipPortal,
  TooltipTrigger,
} from "@/registry/ui/tooltip"
```

```tsx
<Tooltip>
  <TooltipTrigger />
  <TooltipPortal>
    <TooltipContent />
  </TooltipPortal>
</Tooltip>
```
