Tooltip

Short label on hover and on keyboard focus, flipped to stay inside the viewport.

Source
1 file
Dependencies
none
Playground
no

Examples

Every variant of the shipped component, live. Switch the layout to read them as a table or one at a time, and open Code for the file behind them.

01Side
02Align
03Trigger
04Arrow
05Color
06Delay
07Controlled
08Rich content
09Variant
10Radius
11Size
12Interactive
13Close delay
14Icon button

Installation

One package for the whole library — run this once and every component on this site is importable. Adding the tokens to your stylesheet is the other half; the installation guide covers it.

npm install kipui
import { Tooltip, TooltipTrigger, TooltipContent } from "kipui";
Peer dependencies

react 19

react-dom 19

tailwindcss 4

Bundled dependencies

None beyond the peers above.

Usage

tooltip-example.tsx
import { Tooltip, TooltipTrigger, TooltipContent } from "kipui";

<Tooltip>
  <TooltipTrigger>
    <Button variant="ghost" size="icon"><TrashIcon /></Button>
  </TooltipTrigger>
  <TooltipContent side="top">Delete permanently</TooltipContent>
</Tooltip>
  • A tooltip is a label, not a place for content — anything a user must read to proceed belongs in the UI itself.
  • It opens on focus as well as hover, so keyboard users get the same label.
  • Set `interactive` on the content when it holds a link: without it the tooltip closes as the pointer travels towards it.

API reference

Transcribed from the component's own types. Props with no default are required.

Tooltip

PropDefaultDescription
childrenReactNoderequiredRequired. A TooltipTrigger and a TooltipContent.
trigger"hover" | "click" | "focus" | "contextMenu""hover"What opens it. Keyboard focus opens it regardless.
delayDurationnumber100Milliseconds before it opens.
closeDelaynumber0Milliseconds before it closes once the pointer leaves.
variant"default" | "inverted" | "primary" | "destructive" | "success" | "warning" | "info""default"Colour of the bubble.
colorstringrequiredRaw CSS colour for the bubble. Wins over `variant`.
showArrowbooleantrueDraws the arrow pointing at the trigger.
openbooleanrequiredControlled open state.
defaultOpenbooleanrequiredOpen before any interaction. Uncontrolled only.
onOpenChange(open: boolean) => voidrequiredFires whenever it opens or closes.

TooltipTrigger

PropDefaultDescription
childrenReactNoderequiredRequired. The element the tooltip describes.
asChildbooleanfalseRender the child directly instead of wrapping it.

TooltipContent

PropDefaultDescription
side"top" | "bottom" | "left" | "right""top"Preferred side; flips when there isn't room.
align"start" | "center" | "end""center"Alignment along the chosen side.
sideOffsetnumber8Gap between the trigger and the bubble, in pixels.
size"sm" | "md" | "lg""md"Padding and type scale.
radius"none" | "sm" | "md" | "lg" | "full""sm"Corner radius preset.
interactivebooleanfalseKeeps it open while the pointer is over the bubble.