Skip to content

Tooltip

Free

A short label that shows when people point at a control or tab to it, such as the name of an icon button. It can have an arrow.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Render the control through render on TooltipTrigger. Touch screens do not show the tooltip, so an icon button keeps its own aria-label.

The sample also uses Button. One command adds them with this item:

copy-link-button.tsx

Tooltip

PropTypeDefaultDescription
From Base UITooltip.RootBase UI docs
defaultOpenbooleanfalseWhether the tooltip is initially open. To render a controlled tooltip, use the open prop instead.
openboolean—Whether the tooltip is currently open.
onOpenChange—Event handler called when the tooltip is opened or closed.

TooltipTrigger

<button>
PropTypeDefaultDescription
classNamestring—
wrapbooleanfalseRender the trigger as an inline-flex span around its children, in place of render: for a disabled Button that shows why it is off. See the JSDoc of TooltipTrigger. Default false.
From Base UITooltip.TriggerBase UI docs
handleTooltipHandle<unknown>—A handle to associate the trigger with a tooltip.
payloadunknown—A payload to pass to the tooltip when it is opened.
delaynumber600How long to wait before opening the tooltip on hover. Specified in milliseconds.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

TooltipContent

<div>
PropTypeDefaultDescription
classNamestring—
arrowbooleanfalseShow an arrow that points at the trigger. The gap grows from 6px to 10px.
portalProps—Other Base UI props of the inner parts. A className here adds to the component classes.
positionerProps—
arrowPropsPopupPartProps<TooltipArrowProps>—
From Base UITooltip.PositionerBase UI docs
anchor—An element to position the popup against. By default, the popup will be positioned against the trigger.
positionMethod"absolute""fixed"'absolute'Determines which CSS position property to use.
sideOffsetnumber | OffsetFunction0Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a data object parameter with the following properties: - data.anchor: the dimensions of the anchor element with properties width and height. - data.positioner: the dimensions of the positioner element with properties width and height. - data.side: which side of the anchor element the positioner is aligned against. - data.align: how the positioner is aligned relative to the specified side.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

TooltipViewport

<div>
PropTypeDefaultDescription
classNamestring—
From Base UITooltip.ViewportBase UI docs
childrenReactNode—The content to render inside the transition container.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use it for a short label of a control, such as the name of an icon button.
  • Keep the same text in the aria-label of an icon button: touch screens do not show the tooltip.
  • On a disabled Button, set wrap on the trigger and focusableWhenDisabled on the Button.
  • For more text, a link, or a control, use a popup that opens on a click: a tooltip holds only a short label.
  • For a shortcut in text, use a Kbd.
TabOpens the tooltip when the trigger gets focus.
EscCloses the tooltip.

TooltipContent is a Base UI Tooltip.Popup. It opens on hover and on keyboard focus of the trigger, after a 600ms delay, and closes on Esc.

Touch screens do not show the tooltip, so it never holds the only copy of the text. Give an icon button an aria-label with the same words.

On a disabled Button, set wrap on TooltipTrigger and focusableWhenDisabled on the Button. The Button stays in the tab order, so keyboard users can still learn why it is off.

The arrow is hidden from screen readers (aria-hidden).

Open
popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1) · fades in, scales from 95%, comes 4px from the trigger
Close
popup-exit · 120ms · ease-out (0, 0, 0.2, 1)
Keyboard open, Esc, and a swap in a group
none · it shows and hides at once
  1. AddedTooltip.
Open the release