Tooltip
useTooltip is the open machine. Spread getTriggerProps on the trigger. Spread getTooltipProps on Tooltip.Root. Tooltip.Root is tip chrome only: children, className, style, and a dialog name when interactive. There is no Tooltip.Trigger or Tooltip.Content. Do not set interactive on Tooltip.Root.
On this page
Default is text-only role="tooltip". Hover waits for the tooltip.delay.show token, 300ms by default. Focus from keys, such as Tab, opens at once. Focus that follows a press opens no tip, such as a click's, or what a menu closed by a click hands back. A coarse pointer has no hover, so there only keyboard focus opens a tip. While a hover tip is open, and for the next tip's skipDelay milliseconds after the last hover tip closes, that next hover tip opens at once. skipDelay defaults to 300. The hide delay still runs before that window starts. Focus does not start the window. A tip that opens after its delay, by focus, or because its owner opened it fades in by tooltip.motion.duration.enter. One that opens at once inside that window shows without a fade, so a sweep across a toolbar never lags, and every tip closes at once. The fade stays under reduced motion, since nothing moves. A brand can slide a tip that fades in from its trigger with tooltip.motion.offset (0 by default), how far toward the trigger it starts; it moves by layout, a warm tip never slides, and under reduced motion it only fades.
Pass interactive: true to useTooltip. The surface is a non-modal tip dialog. It uses popover="manual" and role="dialog". React Aria PreviewTrigger with Popover also forces role="dialog" on a hover tip that is not a modal. It never uses role="tooltip". Set exactly one of aria-label or aria-labelledby on Tooltip.Root. Links are allowed. Tab moves into those links. Hover can cross onto the panel. Escape returns focus to the trigger and does not reopen until that hold is released. There is no focus trap.
Placement is CSS anchors. The tip sits above the trigger and flips below when it cannot fit. There is no arrow and no placement prop. The tip is drawn in the top layer and placed against its trigger's untransformed box, so a trigger inside an element moved with a CSS transform gets its tip where the trigger would be without the transform. Tooltip.Root renders a <span>, so a trigger and its tip can sit inside a paragraph, as in the Citations recipe. Keep a tip's content to phrasing elements.
Warm-up
Slide from One to Three and each tip after the first opens at once, then land on Waits, which has skipDelay={0} and always waits, even straight from an open tip.
import { Button, Stack, Tooltip, useTooltip } from '@tounsoo/todae';
function WarmButton({ label, tip, skipDelay }: { label: string; tip: string; skipDelay?: number }) {
const tooltip = useTooltip({ showDelay: 300, hideDelay: 0, skipDelay });
return (
<>
<Button.Root tooltip={false} {...tooltip.getTriggerProps()}>
{label}
</Button.Root>
<Tooltip.Root {...tooltip.getTooltipProps()}>{tip}</Tooltip.Root>
</>
);
}
export default function TooltipWarmup() {
return (
<Stack.Root direction="row" gap="none">
<WarmButton label="One" tip="Opens after a pause" />
<WarmButton label="Two" tip="Opens at once" />
<WarmButton label="Three" tip="Opens at once" />
<WarmButton label="Waits" tip="Waits again" skipDelay={0} />
</Stack.Root>
);
}
Examples
Non-button triggers, such as a relative time that tips its exact time, use useTooltip, as the example below does. Mark a non-tabbable trigger with tabIndex={0}. A tap opens no tip, so a +N that stands for hidden chips is ChipList's +N button, which opens a popover with them.
import { formatRelativeTime, Tooltip, useTooltip } from '@tounsoo/todae';
export default function TooltipTime({ locale }: { locale: string }) {
const tooltip = useTooltip();
// A fixed clock, so the demo reads the same on every visit; a product passes its own.
const now = Temporal.ZonedDateTime.from('2026-10-22T09:30:00+09:00[Asia/Seoul]');
const edited = now.subtract({ hours: 5 });
return (
<p>
Edited{' '}
<time {...tooltip.getTriggerProps({ tabIndex: 0 })} lang={locale} dateTime={edited.toInstant().toString()}>
{formatRelativeTime(edited, now, { locale })}
</time>
{/* The exact time names its zone, since it is the clock's, not the reader's. */}
<Tooltip.Root {...tooltip.getTooltipProps()} lang={locale}>
{new Intl.DateTimeFormat(locale, {
year: 'numeric',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: '2-digit',
timeZone: edited.timeZoneId,
timeZoneName: 'short',
}).format(edited.epochMilliseconds)}
</Tooltip.Root>
</p>
);
}
Edited
Interactive tip with a link. Set interactive: true on useTooltip. Set tooltip={false} on Button.Root so the hook owns the machine.
import { Button, Link, Tooltip, useTooltip } from '@tounsoo/todae';
export default function TooltipPolicy() {
const tooltip = useTooltip({ interactive: true });
return (
<>
<Button.Root variant="ghost" tooltip={false} {...tooltip.getTriggerProps()}>
Policy
</Button.Root>
<Tooltip.Root {...tooltip.getTooltipProps()} aria-label="Policy">
Interactive tips allow links. <Link.Root href="#tooltip">Read the policy</Link.Root>
</Tooltip.Root>
</>
);
}
What goes where
| Concern | API |
|---|---|
| Behavior |
|
| Chrome |
|
Button sugar
Icon-only Button.Root tips its accessible name. Pass aria-label or aria-labelledby. A labeled button tips the full string only while the label overflows. tooltip={false} opts out. Fitting labeled buttons do not tip.
import { Button } from '@tounsoo/todae';
import { Archive } from 'lucide-react';
export default function TooltipArchive() {
return (
<Button.Root aria-label="Archive">
<Button.Icon>
<Archive />
</Button.Icon>
</Button.Root>
);
}
Accessible composition
Todae handles: The behaviour above. A text tip is role="tooltip", mounted only while open, and while it is open getTriggerProps adds its id to the trigger's aria-describedby, after the trigger's own ids. It opens on keyboard focus as well as hover, and Escape closes it. An interactive tip is role="dialog" with no focus trap, and Escape from inside it sends focus back to the trigger. In development, Todae logs an error when a text tip holds anything tabbable, an interactive one holds anything but links, or either holds an element that would close a paragraph, such as a <p>, <div> or <li>.
You supply: The trigger's accessible name. The tip describes the trigger and never names it, so an icon-only trigger needs its own aria-label or aria-labelledby. A trigger that takes focus: give a wrap that is not tabbable tabIndex={0}. With interactive: true, exactly one of aria-label or aria-labelledby on Tooltip.Root.
Watch for: Keep what a person needs out of the tip: on a coarse pointer, a tap opens no tip; only keyboard focus does. Pass your own aria-describedby and your focus and pointer handlers through getTriggerProps(props); put after the spread, they replace the tip's. Buttons and menus belong in a Popover or Menu, not a tip.
When to use
When: Short hint for a control (icon-only name, truncated label). A Button.Root tips its own icon-only or truncated label; any other trigger uses useTooltip + surface-only Tooltip.Root. Default tip is text-only (role="tooltip").
When not: Links inside the tip → useTooltip with interactive: true (non-modal tip dialog; links only). Action menus → Menu. Other actions → Popover. Long help → Description. Modal tasks → Dialog. Anything a touch user needs → Popover or text on the page, since a tap opens no tip.
Props
The open machine's props are on useTooltip.
| Name | Type | Description |
|---|---|---|
children | React.ReactNode | Tooltip text, or short prose plus links when interactive. The tip renders a span, so it can sit in a paragraph; keep its content to phrasing elements. |
className | string | Class name for the tip surface. |
style Required | React.CSSProperties | Style for the tip surface. Anchor position comes from getTooltipProps. |
aria-label | string | Accessible name when no visible caption exists. Exactly one of aria-label or aria-labelledby when interactive. |
aria-labelledby | string | Id of the visible caption. Exactly one of aria-label or aria-labelledby when interactive. |