Tooltip

Contextual information displayed on hover, focus, or click. Perfect for providing hints, labels for icon-only buttons, or additional context. Supports multiple placements, color variants, and trigger modes.

Tooltip Placements

Extended Placements

In addition to basic placements, tooltips support start and end alignments for precise positioning.

Color Variants

Use the variant prop to change the tooltip color for semantic meaning.

JSX
<Tooltip content="Default dark tooltip" variant="default">
  <Button>Default</Button>
</Tooltip>

<Tooltip content="Rich light tooltip" variant="rich">
  <Button>Rich</Button>
</Tooltip>

Trigger Modes

Tooltips can be triggered by hover (default), click, or focus events.

Click tooltips close when clicking outside or pressing Escape.
JSX
// Hover trigger (default)
<Tooltip content="Help text" trigger="hover">
  <Button>Hover me</Button>
</Tooltip>

// Click trigger
<Tooltip content="Click again to close" trigger="click">
  <Button>Click me</Button>
</Tooltip>

// Focus trigger
<Tooltip content="Tab to focus" trigger="focus">
  <Button>Focus me</Button>
</Tooltip>

Controlled Mode

Use open and onOpenChange props for fully controlled tooltips.

JSX
<Tooltip
  content="Click to show tooltip"
  trigger="click"
>
  <Button>Click Me</Button>
</Tooltip>

Icon Button Labels

Hover over the icon buttons to see tooltips. Always use aria-label on icon-only buttons.
JSX
<Tooltip content="Save your changes">
  <Button variant="primary" iconOnly leftIcon={<Icon name="check" size="sm" />} aria-label="Save" />
</Tooltip>

<Tooltip content="Delete permanently" variant="default">
  <Button variant="ghost" iconOnly leftIcon={<TrashIcon />} aria-label="Delete" />
</Tooltip>

Rich Content

The content prop accepts any ReactNode, allowing for rich formatted content.

JSX
<Tooltip
  content={
    <div style={{ textAlign: 'center' }}>
      <div style={{ fontWeight: 600 }}>Keyboard Shortcut</div>
      <div>Press <kbd>Ctrl + S</kbd> to save</div>
    </div>
  }
>
  <Button variant="primary">Save</Button>
</Tooltip>

Arrow Control

Use the arrow prop to hide the tooltip arrow pointer.

Delay Configuration

Control how quickly tooltips appear and disappear with delay and hideDelay.

JSX
// Instant appearance
<Tooltip content="Help text" delay={0}>
  <Button>Hover me</Button>
</Tooltip>

// Slow tooltip
<Tooltip content="Help text" delay={500}>
  <Button>Hover me</Button>
</Tooltip>

Accessibility

  • Tooltips appear on focus as well as hover for keyboard accessibility
  • Uses role="tooltip" for screen readers
  • Press Escape to close open tooltips
  • For icon-only buttons, always include aria-label on the button
  • Tooltip content should be supplementary, not essential information

Props Reference

PropTypeDefaultDescription
contentReactNoderequiredTooltip content
placement'top' | 'top-start' | 'top-end' | 'bottom' | ...'top'Tooltip position
variant'dark' | 'light' | 'primary' | 'success' | 'warning' | 'error''dark'Color variant
trigger'hover' | 'click' | 'focus' | 'manual''hover'What triggers the tooltip
delaynumber200Delay before showing (ms)
hideDelaynumber0Delay before hiding (ms)
arrowbooleantrueShow arrow pointer
openboolean-Controlled open state
onOpenChange(open: boolean) => void-Open state change callback
disabledbooleanfalseDisable the tooltip
maxWidthnumber250Maximum tooltip width (px)