Skip to content

Tooltip

A wrapper around React Aria’s TooltipTrigger and Tooltip components. Appears on hover or keyboard focus after a short delay and is announced by screen readers.

Terminal window
npx @a2ra/cli add tooltip
{
"type": "Tooltip",
"props": {
"content": "This action cannot be undone.",
"triggerLabel": "Delete",
"placement": "top"
}
}
PropTypeDescription
contentstringTooltip text
triggerLabelstringLabel for the trigger button
placementtop default
bottom
left
right
Preferred position
isOpenbooleanControlled open state
defaultOpentrue
false default
Open on mount
offsetnumberDistance from the trigger in pixels. Default: 8
crossOffsetnumberPerpendicular offset in pixels. Default: 0
shouldFliptrue default
false
Flip to opposite side when out of bounds
  • Tooltip is for non-interactive hints only. For interactive content, use Popover instead.
  • The tooltip appears after a 1.5s delay on hover and immediately on keyboard focus.
  • Screen readers announce the tooltip content when the trigger is focused.