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.Positioner>
      <Tooltip.Popup>
        <Tooltip.Arrow />
      </Tooltip.Popup>
    </Tooltip.Positioner>
  </Tooltip.Root>
</Tooltip.Provider>

Provider

Provides a shared delay for tooltips so that once a tooltip is shown, the rest of the tooltips in the group will not wait for the delay before showing.

PropTypeDefault
closeDelaynumberundefined
delaynumberundefined
timeoutnumber400

Root

The foundation for building custom-styled tooltips.

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

Trigger

Renders a trigger element that opens the tooltip.

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

Positioner

The tooltip positioner 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
containerReact.Ref | HTMLElement | nullundefined
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

The tooltip popup element.

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

Arrow

Renders an arrow that points to the center of the anchor element.

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