Shares the delays. Required above every Tooltip; the tooltip fails without it.
Tooltip
Holds the open state.
TooltipTrigger
The element that opens it. Use asChild with a Button.
TooltipContent
The dark label. Pick side; it flips when there is no room.
Wrap the tooltip, or a whole region with many tooltips, in one TooltipProvider.
Examples
Sides
Why an action is unavailable
Use aria-disabled instead of disabled on the trigger. A disabled button cannot take focus, so keyboard users would never see the reason.
Delays
The provider sets how long the first tooltip waits (delayDuration) and how long after closing the next one opens at once (skipDelayDuration). The Radix default wait is 700ms.
Content
Name the control as a verb or a noun phrase, in sentence case, without a period: “Excluir tarefa”.
One line. If you need two, the content belongs on the page.
Repeat the accessible name of an icon button; do not add new information.
Never put the only copy of important information in a tooltip.
Do and don’t
DoKeep it to a short name of the action.
Don'tDon't write paragraphs. The text disappears when the pointer moves.
Accessibility
Built on Radix Tooltip. It opens on pointer hover and on keyboard focus, and closes on blur, on pointer leave and with Escape.
The content is linked to the trigger with aria-describedby, so a screen reader reads it as a description. A tooltip does not replace an accessible name: give icon buttons an aria-label too.
The pointer can move onto the tooltip without closing it.
The trigger must be focusable. A disabled button is not, so use aria-disabled.
The tooltip is not shown on touch devices. Do not rely on it there.