Tooltip

Short supporting text for unfamiliar controls.

npm install https://animui.stracture.net/__local/package.tgz
Live · keyboard ready
  • One-line labels on icon-only buttons in toolbars.
  • Revealing the full text of truncated labels on hover or focus.
  • Dense toolbars where moving between icons should show labels instantly after the first one.
  • Use popover for anything with links or controls inside.
  • Use hover-card for rich previews such as a person or link.
  • Avoid it for information people must see on touch devices, where hover does not exist.

Installation

Install animui once, then import any component or block from its typed package entry.

animui · 250 components and blocks

React 19 and React DOM 19 are required. The package includes Free and Pro entries, styles and TypeScript declarations.

npm install https://animui.stracture.net/__local/package.tgz

Load the stylesheet once at your app root, then use the typed component import:

import 'animui/styles.css';
import { Tooltip } from 'animui/tooltip';

Read the Code tab for the implementation files and the API reference below for required props.

Download animui 0.3.0 · Agent guide
example.tsx
import { Tooltip } from "animui/tooltip"; export function ArchiveButton() {  return (    <Tooltip content="Archive">      <button type="button" aria-label="Archive">        <ArchiveIcon />      </button>    </Tooltip>  );}

Tooltip

A short label on hover or focus that opens without delay when moving between tooltips.

PropTypeDefaultDescription
contentRequiredReactNode–Tooltip content. Strings and numbers crossfade and resize when they change while open.
childrenRequiredReactElement–The trigger. Rendered with asChild, so it must accept a ref and be focusable.
side"top" | "bottom""top"Preferred side of the trigger.
Tab
Focusing the trigger opens the tooltip.
Escape
Closes the tooltip.
  • Radix links the content to the trigger with aria-describedby and renders role="tooltip".
  • Content is supplemental: icon-only triggers still need their own aria-label.
  • Do not put interactive elements inside; use popover instead.
  • Opens after 250ms with a 3px rise from 0.97 scale; within 300ms of another tooltip it opens instantly with a fade only.
  • Changing string content rises in with a blur while the bubble springs to the new size.
  • Reduced motion removes the transform and keeps a 90ms opacity fade.
  • The bubble caps at 15rem and wraps longer text; Radix flips it to the other side near viewport edges.
  • It opens on hover and keyboard focus, so touch users rarely see it; never hide essential information in one.
  • Each tooltip brings its own provider and mounts content in a portal only while open.
  • A ResizeObserver measures the text only to spring the bubble size when content changes while open.

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

  • Use for one-line labels on icon buttons and truncated text. Use hover-card for rich previews and popover for anything interactive.
  • Each Tooltip brings its own provider; no app-level wrapper is needed.
/components/tooltip/markdown

The full library index for assistants is at /llms.txt.