Tooltip
Show supplemental, non-interactive information on hover or focus.
Use Tooltip for supplemental information on hover or focus. The trigger must still have its own accessible name when the control needs one.
Basic usage#
Playground#
Anatomy#
Content is portaled inside an internal positioning wrapper. String content uses the text slot; JSX content renders directly inside Content.
Usage#
Supplemental information#
Use tooltips for non-interactive hints that supplement an already labeled trigger. Do not use tooltip text as the sole accessible name of an icon-only control.
Triggering and shortcuts#
Tooltip opens from pointer hover and focus. kbds displays shortcut notation alongside the hint; it does not register that shortcut. Set kbdVariant on Tooltip.Content to default, outline, or invert. When omitted, keycaps follow the content’s invert setting.
Keyboard interaction#
Focusing a focusable trigger can display the tooltip. Escape dismisses an open tooltip according to the shared tooltip overlay behavior; focus remains on the trigger rather than moving into the tooltip content.
Examples#
Keyboard shortcuts#
Attributes#
data-closedSlot: tooltip-trigger, tooltip-contentDescription: Present when disclosure or transition content is closed.data-disabledSlot: tooltip-triggerDescription: Present when the component, slot, or item is disabled.data-expandedSlot: tooltip-trigger, tooltip-contentDescription: Present when the panel, accordion, or menu is expanded.data-alignSlot: tooltip-contentDescription: Stores the resolved alignment of positioned content.data-instant-motionSlot: tooltip-contentDescription: Present when enter and exit motion should complete immediately.data-sideSlot: tooltip-contentDescription: Stores the resolved floating or drawer content side.Props#
Tooltip#
Trigger#
Renders a <button> element by default.
Content#
Props for the Tooltip component. Renders a <div> element by default.