Tooltip
A tooltip component for displaying contextual information on hover or focus. Built on Base UI Tooltip primitive with three content variants: Simple, Explainer, and Breakdown.Compound Components
Tooltip.Provider
Optional provider for consistent delay across multiple tooltips.Delay in milliseconds before showing tooltips.
Delay in milliseconds before hiding tooltips.
Tooltip.Root
The root container that manages tooltip state.Controlled open state. When provided, the tooltip becomes controlled.
Uncontrolled default open state.
Callback fired when the open state changes.
Delay in milliseconds before showing the tooltip (overrides Provider delay).
Delay in milliseconds before hiding the tooltip (overrides Provider closeDelay).
Tooltip.Trigger
The trigger element that shows the tooltip on hover/focus.Additional CSS classes to apply.
Merge props onto the child element instead of rendering a button.
Tooltip.Portal
Portals the tooltip content to the end of the document body.Whether to keep the tooltip mounted in the DOM when closed.
The container element to portal into. Defaults to
document.body.Tooltip.Positioner
Positions the tooltip relative to the trigger.The side of the trigger to position the tooltip.
The alignment of the tooltip relative to the trigger.
The distance in pixels from the trigger.
The offset in pixels along the alignment axis.
collisionPadding
number | { top?: number; right?: number; bottom?: number; left?: number }
default:"8"
The padding in pixels from the viewport edges.
Tooltip.Popup
The tooltip popup container with inverse surface styling.Additional CSS classes to apply. Default: Dark background with shadow and backdrop blur.
- Scale from 0.96 to 1 with fade
- Spring transition (bounce: 0, duration: 0.15s)
- Respects reduced motion preferences
Tooltip.Arrow
Optional arrow pointing to the trigger.Additional CSS classes to apply. Default:
"fill-surface-inverse" with drop shadow.Tooltip.Simple
Simple tooltip variant with text and optional keyboard shortcut.Optional keyboard shortcut keys to display (e.g.,
["⌘", "K"]).Additional CSS classes to apply.
- Text only: 12px horizontal, 8px vertical padding
- Text + shortcut: 12px left, 8px right, 8px vertical padding
Tooltip.Explainer
Explainer tooltip variant with title, description, and optional shortcut.The tooltip title.
Optional keyboard shortcut keys to display.
Additional CSS classes to apply.
Tooltip.Breakdown
Breakdown tooltip variant for data visualizations (charts, graphs).The tooltip title.
Optional description text.
Array of breakdown items with label, value, and optional color.
Additional CSS classes to apply.
Usage
Simple Tooltip
With Keyboard Shortcut
Explainer Tooltip
Breakdown Tooltip (Charts)
Multiple Tooltips with Provider
Types
Accessibility
- Tooltip is linked to trigger via
aria-describedby - Opens on hover and focus
- Closes on blur, mouse leave, and Escape key
- Respects
prefers-reduced-motion - Keyboard shortcuts are displayed with KbdGroup component for proper semantics