Tooltip
The <Tooltip>
component offers users short, contextual hints when they hover or focus on specific UI elements. It displays a hint alongside the referenced element, working together to unobtrusively clarify elements in the interface. It’s ideal for brief, passive help that doesn’t require interaction or persistent visibility.
Anatomy

- Trigger: Indicator that can be activated on hover or focus.
- Caret tip: Closely associates the tooltip to term to be defined.
- Tooltip: Holds the informative text or message.
Appearance
The appearance of a component can be customized using the variant
and size
props. These props adjust the visual style and dimensions of the component, available values are based on the active theme.
Property | Type | Description |
---|---|---|
variant | default | white | The available variants of this component. |
size | - | The available sizes of this component. |
Usage
Tooltips are best used to provide concise, supportive information for UI elements that may need clarification. They should be brief, non-essential, and avoid disrupting the flow of interaction. Use them to explain unfamiliar icons, edge cases, or provide hints that help users without cluttering the interface.
Icons without visible labels can be unclear, especially for less familiar actions. A tooltip offers quick, contextual clarification by revealing the icon’s purpose on hover or focus. For example, a tooltip might clarify that an icon represents "Download as PDF" when the label is not visible.
Avoid using tooltips for critical information, long explanations, or interactive content. If users need persistent guidance, longer descriptions, or help while interacting with a task, consider components like contextual help, the help text of a form fields, or a message displayed inline. These patterns are better suited for complex or essential information that should not disappear when the user moves their cursor.
Use tooltips to explain icons without a label or to describe uncommon behavior.
Don't use tooltips if the information is essential to complete a task.
Show on focus
Tooltips can also appear when an element receives keyboard focus, not just on hover. This ensures that users who navigate via keyboard or assistive technologies receive the same helpful information as mouse users.
Use focus-triggered tooltips to improve accessibility, especially for icon-only buttons, form controls, or compact layouts where context is not visually obvious. It’s particularly helpful when the tooltip content clarifies the purpose of an element that lacks a label or descriptive text.
To enable this behavior, set the trigger
prop on <Tooltip.Trigger>
to "focus"
.
Accessibility
You do not need to set aria-describedby manually because the <Tooltip>
component sets it for you. However, if the button contains only an image or icon such as an SVG, make sure to provide an aria-label
on the button for screen readers, and consider setting aria-hidden="true"
on the image to avoid redundant announcements.
Props
Tooltip
UNSTABLE_portalContainer?
Element;
"document.body"
aria-describedby?
string;
aria-details?
string;
aria-label?
string;
aria-labelledby?
string;
arrowBoundaryOffset?
number;
0
children?
ReactNode;
containerPadding?
number;
12
crossOffset?
number;
0
defaultOpen?
boolean;
dir?
string;
hidden?
boolean;
inert?
boolean;
isEntering?
boolean;
isExiting?
boolean;
lang?
string;
offset?
number;
0
onAnimationEnd?
AnimationEventHandler<HTMLDivElement>;
onAnimationEndCapture?
AnimationEventHandler<HTMLDivElement>;
onAnimationIteration?
AnimationEventHandler<HTMLDivElement>;
onAnimationIterationCapture?
AnimationEventHandler<HTMLDivElement>;
onAnimationStart?
AnimationEventHandler<HTMLDivElement>;
onAnimationStartCapture?
AnimationEventHandler<HTMLDivElement>;
onAuxClick?
MouseEventHandler<HTMLDivElement>;
onAuxClickCapture?
MouseEventHandler<HTMLDivElement>;
onClick?
MouseEventHandler<HTMLDivElement>;
onClickCapture?
MouseEventHandler<HTMLDivElement>;
onContextMenu?
MouseEventHandler<HTMLDivElement>;
onContextMenuCapture?
MouseEventHandler<HTMLDivElement>;
onDoubleClick?
MouseEventHandler<HTMLDivElement>;
onDoubleClickCapture?
MouseEventHandler<HTMLDivElement>;
onGotPointerCapture?
PointerEventHandler<HTMLDivElement>;
onGotPointerCaptureCapture?
PointerEventHandler<HTMLDivElement>;
onLostPointerCapture?
PointerEventHandler<HTMLDivElement>;
onLostPointerCaptureCapture?
PointerEventHandler<HTMLDivElement>;
onMouseDown?
MouseEventHandler<HTMLDivElement>;
onMouseDownCapture?
MouseEventHandler<HTMLDivElement>;
onMouseEnter?
MouseEventHandler<HTMLDivElement>;
onMouseLeave?
MouseEventHandler<HTMLDivElement>;
onMouseMove?
MouseEventHandler<HTMLDivElement>;
onMouseMoveCapture?
MouseEventHandler<HTMLDivElement>;
onMouseOut?
MouseEventHandler<HTMLDivElement>;
onMouseOutCapture?
MouseEventHandler<HTMLDivElement>;
onMouseOver?
MouseEventHandler<HTMLDivElement>;
onMouseOverCapture?
MouseEventHandler<HTMLDivElement>;
onMouseUp?
MouseEventHandler<HTMLDivElement>;
onMouseUpCapture?
MouseEventHandler<HTMLDivElement>;
onOpenChange?
(isOpen: boolean) => void;
onPointerCancel?
PointerEventHandler<HTMLDivElement>;
onPointerCancelCapture?
PointerEventHandler<HTMLDivElement>;
onPointerDown?
PointerEventHandler<HTMLDivElement>;
onPointerDownCapture?
PointerEventHandler<HTMLDivElement>;
onPointerEnter?
PointerEventHandler<HTMLDivElement>;
onPointerLeave?
PointerEventHandler<HTMLDivElement>;
onPointerMove?
PointerEventHandler<HTMLDivElement>;
onPointerMoveCapture?
PointerEventHandler<HTMLDivElement>;
onPointerOut?
PointerEventHandler<HTMLDivElement>;
onPointerOutCapture?
PointerEventHandler<HTMLDivElement>;
onPointerOver?
PointerEventHandler<HTMLDivElement>;
onPointerOverCapture?
PointerEventHandler<HTMLDivElement>;
onPointerUp?
PointerEventHandler<HTMLDivElement>;
onPointerUpCapture?
PointerEventHandler<HTMLDivElement>;
onScroll?
UIEventHandler<HTMLDivElement>;
onScrollCapture?
UIEventHandler<HTMLDivElement>;
onTouchCancel?
TouchEventHandler<HTMLDivElement>;
onTouchCancelCapture?
TouchEventHandler<HTMLDivElement>;
onTouchEnd?
TouchEventHandler<HTMLDivElement>;
onTouchEndCapture?
TouchEventHandler<HTMLDivElement>;
onTouchMove?
TouchEventHandler<HTMLDivElement>;
onTouchMoveCapture?
TouchEventHandler<HTMLDivElement>;
onTouchStart?
TouchEventHandler<HTMLDivElement>;
onTouchStartCapture?
TouchEventHandler<HTMLDivElement>;
onTransitionCancel?
TransitionEventHandler<HTMLDivElement>;
onTransitionCancelCapture?
TransitionEventHandler<HTMLDivElement>;
onTransitionEnd?
TransitionEventHandler<HTMLDivElement>;
onTransitionEndCapture?
TransitionEventHandler<HTMLDivElement>;
onTransitionRun?
TransitionEventHandler<HTMLDivElement>;
onTransitionRunCapture?
TransitionEventHandler<HTMLDivElement>;
onTransitionStart?
TransitionEventHandler<HTMLDivElement>;
onTransitionStartCapture?
TransitionEventHandler<HTMLDivElement>;
onWheel?
WheelEventHandler<HTMLDivElement>;
onWheelCapture?
WheelEventHandler<HTMLDivElement>;
open?
boolean;
placement?
Placement;
'top'
shouldFlip?
boolean;
"true"
translate?
"yes" | "no";
triggerRef?
RefObject<Element | null>;
Tooltip.Trigger
children
ReactNode;
closeDelay?
number;
500
defaultOpen?
boolean;
delay?
number;
1000
disabled?
boolean;
onOpenChange?
(isOpen: boolean) => void;
open?
boolean;
trigger?
"focus";
Alternative Components
- ContextualHelp: Use when users need more detailed, persistent guidance near a specific element or task.
- SectionMessage: Use to highlight important information inline that should remain visible as users read or interact with the page.