--- title: Tooltip description: A popup that appears when an element is hovered or focused, showing a hint. links: doc: https://base-ui.com/react/components/tooltip#api-reference --- ## Preview ## Installation CLI Manual ```bash npx @olyx/cli@latest add tooltip ``` Install the following dependencies: ```bash npm install @base-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip" ``` ```tsx }> Hover me Helpful hint ``` ## API Reference ### Tooltip Root component. Wraps `Tooltip.Root` from Base UI with a built-in `TooltipProvider` (300ms delay). ### TooltipTrigger Trigger element. Alias for `Tooltip.Trigger` from Base UI. ### TooltipContent Popup container that displays the tooltip content. Also exported as `TooltipContent`. | Prop | Type | Default | | ------------- | ----------------------------------------- | ---------- | | `side` | `"top" \| "bottom" \| "left" \| "right"` | `"top"` | | `align` | `"start" \| "center" \| "end"` | `"center"` | | `sideOffset` | `number` | `6` | | `alignOffset` | `number` | `0` | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `variant` | `"dark" \| "light"` | `"dark"` | All props from [Base UI Tooltip](https://base-ui.com/react/components/tooltip#api-reference) are also supported. ## Examples ### Light ### Positioning ### Small ### Large