Tooltip

A label's whisper on hover and focus.

v1.0.0·Updated Jul 8, 2026 · 10:45
Live Demo — Fully Interactive
Hover or Tab to a button
TopOpens aboveBottomOpens belowLeftOpens leftRightOpens right
Configuration
Placement
Trigger
Label
Duplicate
<Tooltip placement="top" label="Duplicate"></Tooltip>
Behavior — The Engineering Contract
Props
PropTypeDefaultDescription
labelstringThe hint. One short line, no markup
placementtop · bottom · left · righttopSide the bubble opens toward
childrenReactNodeThe trigger; must be focusable
delaynumber200ms before showing on hover (0 on focus)
Events & keyboard
TriggerResult
HoverShows after the delay; hides on leave
Focus (Tab)Shows immediately — keyboard parity with hover
EscapeDismisses while the trigger stays focused
aria-describedbyLinks the trigger to the bubble for screen readers

A tooltip is supplementary, never essential. It shows on focus as well as hover, so it never hides behind a pointer. If the content is interactive, or the user must read it to succeed, it belongs in the layout — a popover or the page.

Anatomy
Duplicate2341
1WrapperInline-flex, position relative. Anchors the bubble and owns the hover / focus state.
2BubbleThe dark label, one line, no wrapping. Presentational only, never clickable.
3ArrowA rotated ::after square pointing at the trigger, so the source is unmistakable.
4TriggerAny focusable element. Tab reveals the tooltip just as hover does.
Do's and Don'ts
✓ Do
Duplicate

Name icon-only buttons. A one-word label turns a glyph into an unambiguous action.

✕ Don't
Read this whole paragraph before you continue, then click…

Don't hide paragraphs or steps in a tooltip. Anything essential belongs on the page.

✓ Do
Needs review access

Explain why a control is disabled. The tooltip answers the question before it is asked.

✕ Don't
Edit · Delete

Don't put buttons or links in a tooltip. Interactive content on hover is a menu or popover.

In context: Examples
A · Icon toolbar
Link

Dense icon rows lean on tooltips so every glyph still says its name.

B · Truncated text
optimistic-design-system-tokens.jsonoptimistic-design-system-tokens.json

When a label is clipped, the tooltip reveals it in full on hover or focus.

C · Info icon
Sync statusLast push, 2 min ago

An info icon offers a definition without spending permanent space on it.

Measurements & Tokens
TokenValueRole
--tip-bg#1A1D27Bubble surface (arrow inherits it)
--tip-border#262A34Bubble hairline
--tip-fg#E7E9EELabel text
--tip-size0.72remLabel type size
--tip-radius6pxCorner radius
--tip-offset8pxGap from the trigger
--tip-delay200msHover open delay; 0 on focus
--tip-ease0.16sFade + 3px slide
Code
<span class="o-tip-wrap">
  <button class="o-btn o-btn--icon" aria-describedby="tt1">⧉</button>
  <span id="tt1" role="tooltip" class="o-tip o-tip--top">Duplicate</span>
</span>