Tooltip
A tooltip on web, with only accessibility output on native
Tooltip adds positioned, animated context to a trigger while preserving an accessible description.
Features
Opening after the mouse stops moving
Enter and exit animations
Sizing, positioning, and styled or unstyled modes
Tooltip displays contextual information when hovering over an element. It waits for your mouse to stop moving before appearing, supports animations, and automatically stacks above other content.
Installation
Tooltip is already installed in tamagui, or you can install it independently:
yarn
npm
bun
pnpm
Anatomy
API reference
Tooltip
Contains every component for the tooltip.
Props
children (required)
React.ReactNode
Must contain Tooltip.Content
groupId
string
If given, will work alongside TooltipGroup to ensure only one tooltip in the groups stays open.
restMs
number
Time needed for cursor to rest before showing.
delay
number | { open?: number; close?: number }
Time to wait before showing (can be set independently for open/close).
placement
Placement
'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end'
open
boolean
The controlled open state of the tooltip.
defaultOpen
boolean
The open state when initially rendered.
onOpenChange
(open: boolean) => void
Event handler called when the open state changes.
modal
boolean
Default:
trueRenders into root of app instead of inline.
stayInFrame
ShiftProps | boolean
Default:
{ padding: 10 }Shifts the tooltip horizontally to stay within viewport bounds. Pass an object to customize shift behavior (mainAxis, crossAxis, padding).
allowFlip
FlipProps
See floating-ui flip().
offset
OffsetOptions
Determines the distance the Tooltip appears from the target, see floating-ui offset().
zIndex
number
Sets the z-index of the tooltip portal. Only needed for global/scoped tooltips mounted at the root - inline tooltips automatically participate in z-index stacking. See the Scoping section below.
On native, pair modal tooltips with native portal setup to preserve React context inside Tooltip content.
Tooltip.Trigger
Used to trigger opening of the tooltip when uncontrolled, see YStack in Stacks.
Tooltip.Content
Renders as a YStack (see Stacks); size sets width and height.
Tooltip.Anchor
Renders as YStack, see Stacks.
When you want the Trigger to be in another location from where the Tooltip attaches, use Anchor. When used, Anchor is where the Tooltip will attach, while Trigger will open it.
TooltipGroup
This allows you to logically group any tooltips rendered below this component. You can control their delay props, and components inside a TooltipGroup will be smart about opening quicker if you are moving between targets with tooltips, ensuring that subsequent tooltips show immediately rather than after a delay.
See the Floating UI docs for full details on how this works.
Props
delay
number | { open?: number; close?: number }
The delay to use for the group.
timeoutMs
number
An optional timeout to use for the group, which represents when grouping logic will no longer be active after the close delay completes. Useful if you want grouping to last longer than the close delay, for example if there is no close delay at all.
preventAnimation
boolean
Will disable the enter/exit animations while the group is active, but not for the initial enter animation of the first hovered tooltip.
closeOpenTooltips
A small helper function of type () => void that will close any open tooltips.
Scoping
Tooltip supports scoping which lets you mount a single Tooltip instance at the root of your app, while having deeply nested Trigger components anywhere in your tree attach to that single parent Tooltip.
This is useful for performance - you only render Tooltip.Trigger in your
list items or buttons, while the heavier Tooltip and Tooltip.Content live
at the root. It also lets you style all your tooltips consistently in one place.
When using a global scoped tooltip, you should set zIndex to ensure tooltips appear above dialogs and other portaled content. This is because the global tooltip’s portal is mounted outside the stacking context of other portals. Inline tooltips (rendered alongside their trigger) automatically participate in z-index stacking and don’t need this.
_layout.tsx
MyButton.tsx
The scope prop on Trigger connects it to the Tooltip with the matching scope.