Skip to content
GitHub (opens in a new tab)

Tooltip

Brief supplementary text on hover or focus of a trigger element.

stableAtomcontracts/tooltip.json

Preview

Tooltip

A short name for a control on hover or focus. On touch a tap pins it. It flips to the other side when there is no room and stays on screen.

Master

Hover or focus the trigger. The tooltip sits on top and flips when there is no room.

Usage

Tooltip names a control in a few words. HelpPopover explains it in one to three sentences. Popover holds fields or actions. Do not put links or buttons in a Tooltip.

Do's

  • Explaining an icon or abbreviated label
  • Non-critical context that should not clutter the layout
  • Which one: Tooltip names a control in a few words; HelpPopover explains it in one to three sentences; Popover holds fields or actions and takes focus. None of them is a menu or a blocking decision.

Don'ts

  • Essential instructions — put them in visible hint text via Field
  • A sentence or two of help — use HelpPopover
  • Large content or forms — use Modal
  • Navigation — use SideNav (product) or DocsNav (docs/catalog)
<Tooltip content="Export includes all projects" placement="top">
  <Button appearance="outline" mode="neutral" size="sm">Export</Button>
</Tooltip>

When to use

  • Explaining an icon or abbreviated label
  • Non-critical context that should not clutter the layout
  • Which one: Tooltip names a control in a few words; HelpPopover explains it in one to three sentences; Popover holds fields or actions and takes focus. None of them is a menu or a blocking decision.

When not to use

  • Essential instructions — put them in visible hint text via Field
  • A sentence or two of help — use HelpPopover
  • Large content or forms — use Modal
  • Navigation — use SideNav (product) or DocsNav (docs/catalog)

What an agent reads

import { Tooltip } from "agentic-ds-kit";
must
  • Escape hides an uncontrolled tooltip without closing a parent Modal, Drawer or AlertDialog
  • Trigger must be focusable
  • Tooltip content available to assistive tech on focus
  • Hover after delay; focus shows at once; on touch a tap pins it and a tap elsewhere closes it
  • Pointer can move onto the bubble without it closing (100ms hide grace)
  • Portal the bubble to document.body so overflow never clips it
defaults
  • placement top
  • delay 150
  • disabled false
stops if
  • Do not invent local Tooltip
  • Do not use raw hex
  • Do not hide required form labels in tooltips
  • Do not put links, buttons, or more than one short line in a Tooltip — use HelpPopover or Popover

From contracts/tooltip.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
contentstringYes——
placementtop | bottom | left | rightNotopPreferred side. Flips to the other side when there is no room and stays inside the viewport.
delaynumberNo150Hover waits; focus shows at once. Leaving waits 100ms so the pointer can reach the bubble.
openbooleanNo—controlled visibility
disabledbooleanNofalse—
childrenslotYes——
  • Component
    →

    Field

    One labeled control with optional hint and an error or success message.

  • Component
    →

    HelpPopover

    Small help panel: optional title plus one to three short sentences.

  • Component
    →

    Modal

    Dismissible overlay for short tasks, forms, or extra detail.

  • Component
    →

    SideNav

    Product side nav: brand header, icon items, optional badges, closeable; variant single (one column that closes to an icon rail) or rail-subnav (a fixed icon rail plus a SideNav.SubNav column with the picked parent's rows).