Tooltip

A short label that appears on hover or focus.

Installation

  1. Add the registryOnce per project
  2. Add tooltip

Usage

Wrap your app in a TooltipProvider once, near its root.

Then give each control its own tooltip.

Screen readers ignore tooltips, so the trigger still needs its own accessible name, like an aria-label. Don't put anything essential in a tooltip. For an info icon, use a Popover infotip instead.

Composition

Examples

With a shortcut

Sides

side and align on TooltipContent set its position.

Disabled triggers

A tooltip can explain why a control is disabled. Add focusableWhenDisabled so the button still gets focus and taps, and give it the reason in aria-description for screen readers.

Opening on tap

Tooltips don't open on touch screens unless the trigger is disabled. openOnTap opens one on tap anyway, and openOnTap={false} turns it off for a disabled trigger.

Edited

Props

The tables leave out className, style and render. Parts built on Base UI take them as its styling and composition guides describe.

TooltipProvider

Tooltip

TooltipTrigger

TooltipContent