Skip to contentKino
Skip to Content

Tooltip

A short label that grows out of its trigger on hover and focus, and slides between the triggers of a group.

npx shadcn add https://kinoui.com/r/tooltip.json
Share on

Examples

Default

It grows out of its trigger after a short wait, and folds back into it.

Group

Tooltips in a TooltipGroup share one label, which slides from trigger to trigger.

Sides

Pick where it opens with side; it moves when that side has no room.

Disabled

A disabled button takes no pointer events, so a span around it is the trigger, and the button carries the reason for a screen reader.

Installation

npx shadcn@latest add https://kinoui.com/r/tooltip.json
Files
lib/reduce-motion.tslib/popup.tslib/glide.tsxlib/refs.tscomponents/kino/tooltip.tsx
Packages
@base-ui/react

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

TooltipProvider

PropTypeDefaultDescription
delaynumber200How long the pointer rests on a trigger before the first opens, in milliseconds.

Tooltip

PropTypeDefaultDescription
openbooleanNoneWhether it is open, when you hold the state.
onOpenChange(open, details) => voidNoneCalled when it opens or closes.

TooltipTrigger

PropTypeDefaultDescription
closeOnClickbooleantrueWhether a click closes it. Turn it off when the label answers the click, such as “Copied”.

TooltipContent

PropTypeDefaultDescription
side'left''top''bottom''right''inline-start''inline-end''top'The side of the trigger it opens on.
align'start''center''end''center'How it lines up with the trigger along that side.
sideOffsetnumberfunction6The gap between it and the trigger, in pixels.
classNamestringNoneGoes to the label inside the box, which is at most max-w-64.

TooltipPopup

PropTypeDefaultDescription
anchorElementfunctionNoneAn element to place it against in place of the trigger.

Accessibility

  • It opens on hover and on keyboard focus, and Escape closes it.
  • The label describes its trigger for a screen reader. An icon-only trigger still needs its own aria-label.
  • Touch has no hover, so never put anything in a tooltip that people can’t find another way.
  • When the system asks for less motion, it only fades.