Back to Components

Overlay

Tooltip

Hover- or focus-triggered short label. Smaller than Popover and non-interactive — content shouldn't accept clicks. Use for icon-button labels and abbreviation hints.

Examples

Default (top)

<Tooltip content="Search · ⌘K">
  {#snippet trigger(props)}
    <Button icon aria-label="Search" {...props}>⌕</Button>
  {/snippet}
</Tooltip>

side="right"

<Tooltip content="Saved 4 minutes ago" side="right">
  {#snippet trigger(props)}
    <Button variant="ghost" size="sm" {...props}>Saved</Button>
  {/snippet}
</Tooltip>

Custom delay

<Tooltip content="Shows immediately" delayDuration={0}>
  {#snippet trigger(props)}
    <Button variant="outline" {...props}>Instant</Button>
  {/snippet}
</Tooltip>

Props

PropTypeDefaultDescription
contentstringTooltip text. Keep to one line ideally.
side'top' | 'right' | 'bottom' | 'left''top'Edge of the trigger to anchor.
sideOffsetnumber6Gap (px) between trigger and tooltip.
delayDurationnumber250How long the trigger must be hovered before showing.
triggerSnippet<[TriggerProps]>Snippet receiving bits-ui props. Spread them onto your own element so it (not a wrapper) is the actual trigger.

Install

CLI

npm install bits-ui
npx @a3tai/mittsu add tooltip