Tooltip
Shows a short hint when you hover over or focus its trigger.
tooltip-demo.tsx
Installation
The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.
npm
yarn
pnpm
bun
Composition
TooltipTriggerButtonIt must be focusable.
TooltipContentTooltipArrowOptional
Placement and arrow
If there is no space, the tooltip moves to the opposite side.
tooltip-placement-demo.tsx
API reference
vip/ui adds or changes the props below. For all other props, see React Aria Tooltip (opens in a new tab).
TooltipTrigger
- delay: number = 400
- Milliseconds of hover before the tooltip opens. Keyboard focus opens it at once.
TooltipContent
- offset: number = 8
- Distance from the trigger in pixels.
- placement: "top" | "bottom" | "left" | "right" | "start" | "end" = "top"
- The side of the trigger that the tooltip opens on. If there is not sufficient space, the tooltip moves to the opposite side.
- arrowBoundaryOffset: number = 8
- The minimum distance from TooltipArrow to the tooltip edge. It keeps the arrow off the rounded corner.