Components
Tooltip
A tiny helper overlay for labels, shortcuts, and microcopy that should stay out of the main layout.
Loading...
Installation
Install the registry item directly, then add any package dependencies if you are setting the component up manually.
1
Install the component
Run the registry command below to add tooltip to your project.
watermelon add tooltip2
Import the component
Import Tooltip from your local UI registry output.
Import
import { Tooltip } from "@/components/ui/tooltip";Import
Import
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";Usage
Tooltips work best for brief explanations, labels, and shortcut hints.
Loading...
API Reference
| prop | type | default | description |
|---|---|---|---|
| defaultOpen | boolean | false | Sets the initial open state for uncontrolled tooltips. |
| open | boolean | - | Controls tooltip visibility from parent state. |
| onOpenChange | (open: boolean) => void | - | Called whenever the tooltip opens or closes. |
| asChild | boolean | false | Forwards tooltip interactions into an existing child trigger. |