Skip to content

Tooltip

Tooltip that shows information on hover.

Basic Usage

Wrap the target element with Tooltip and set the content prop.

tsx
import { Tooltip, Button } from '@airo-ui/react'

function Demo() {
  return (
    <div style={{ display: 'flex', gap: 16 }}>
      <Tooltip content="Top tooltip">
        <Button>Top</Button>
      </Tooltip>
      <Tooltip content="Bottom tooltip" placement="bottom">
        <Button>Bottom</Button>
      </Tooltip>
      <Tooltip content="Left tooltip" placement="left">
        <Button>Left</Button>
      </Tooltip>
      <Tooltip content="Right tooltip" placement="right">
        <Button>Right</Button>
      </Tooltip>
    </div>
  )
}

Disabled

tsx
<Tooltip content="Won't show" disabled>
  <Button variant="ghost">Disabled Tooltip</Button>
</Tooltip>

API

Props

NameTypeDefaultDescription
contentstring''Tooltip text
placement'top' | 'bottom' | 'left' | 'right''top'Display position
delaynumber100Show/hide delay (ms)
disabledbooleanfalseDisable tooltip
childrenReact.ReactNodeRequiredTarget element triggering the tooltip

Interaction

  • Delayed show on hover/focus, delayed hide on leave
  • Four directional placement with auto-flip
  • Arrow pointer pointing to trigger element
  • 100ms debounce on enter/leave

MIT License