Tooltip

A popup that appears when an element is hovered or focused, showing a hint for sighted users.

API reference

Import the component and place its parts the following way:

Anatomy
import { Tooltip } from '@base-ui-components/react/tooltip';

<Tooltip.Provider>
  <Tooltip.Root>
    <Tooltip.Trigger />
    <Tooltip.Portal>
      <Tooltip.Positioner>
        <Tooltip.Popup>
          <Tooltip.Arrow />
        </Tooltip.Popup>
      </Tooltip.Positioner>
    </Tooltip.Portal>
  </Tooltip.Root>
</Tooltip.Provider>

Provider

Provides a shared delay for multiple tooltips. The grouping logic ensures that once a tooltip becomes visible, the adjacent tooltips will be shown instantly.

PropTypeDefault
closeDelaynumberundefined
delaynumberundefined
timeoutnumber400

Root

Groups all parts of the tooltip. Doesn’t render its own HTML element.

PropTypeDefault
closeDelaynumber0
defaultOpenbooleanfalse
delaynumber600
hoverablebooleantrue
onOpenChange(open, event, reason) => voidundefined
openbooleanundefined
trackCursorAxis'none' | 'x' | 'y' | 'both''none'

Trigger

An element to attach the tooltip to. Renders a <button> element.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Portal

A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to the <body>.

PropTypeDefault
containerReact.Ref | HTMLElement | nullundefined
keepMountedbooleanfalse

Positioner

Positions the tooltip against the trigger. Renders a <div> element.

PropTypeDefault
align'start' | 'center' | 'end''center'
alignOffsetnumber0
anchor| React.Ref
| Element
| VirtualElement
| (() => Element
| VirtualElement
| null)
| null
undefined
arrowPaddingnumber5
classNamestring | (state) => stringundefined
collisionBoundary| 'clippingAncestors'
| Element
| Element[]
| Rect
'clipping-ancestors'
collisionPaddingnumber | Rect5
keepMountedbooleanfalse
positionMethod'absolute' | 'fixed''absolute'
render| React.ReactElement
| (props, state) => React.ReactElement
undefined
side| 'bottom'
| 'inline-end'
| 'inline-start'
| 'left'
| 'right'
| 'top'
'top'
sideOffsetnumber0
stickybooleanfalse
CSS VariableType
--anchor-heightnumber
--anchor-widthnumber
--available-heightnumber
--available-widthnumber
--transform-originstring

A container for the tooltip contents. Renders a <div> element.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Arrow

Displays an element positioned against the tooltip anchor. Renders a <div> element.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined