Skip to content
Protocore Design Systemv1.6.9

/// Overlay

Tooltip

A hover/focus tip on a dark panel that labels or briefly explains the element it points at.

import { Tooltip, TooltipProvider } from "@protocore/pds";
View as Markdown

Basics

Wrap any focusable element. content is the tip; children is the trigger, mounted via asChild. Icon-only triggers must still carry their own aria-label.

Placement

side picks the preferred edge; Radix flips it on collision. Keep sideOffset small — the tip should read as attached to the trigger.

Inline explanation

Tooltips can annotate a word inside running text. The panel caps at 280px and never traps focus — content is advisory, never essential.

Cluster health is degraded but still writing blocks.

When to use it

Reach for a Tooltip to label an icon-only control or add a one-line clarification that the user can safely ignore. It appears on hover or focus, holds nothing interactive, and vanishes on the next move.

If the tip contains a link, button, or copy the user must read to proceed, it is not a Tooltip. Use a [Popover](/overlay/popover) for interactive floating content, a [HoverCard](/overlay/hover-card) for a rich hover preview of an entity, and [HelpTip](/inputs/help-tip) for a persistent question-mark affordance beside a form field. Never put anything essential — or anything only reachable by hover — inside a Tooltip.

Usage

Do

  • Label icon-only buttons so their action is discoverable.
  • Keep content to a single short line — 280px is the ceiling.
  • Rely on the built-in 300ms delay so tips don't flash during pointer travel.
  • Wrap one focusable trigger so keyboard users get the tip too.

Don't

  • Put links, buttons, or form controls inside — use a Popover.
  • Hide information the user actually needs to complete a task.
  • Attach a tip to a disabled element (it can't receive focus or hover).
  • Stack paragraphs of prose into the panel — that's a HoverCard.

Accessibility

KeysAction
TabMoves focus to the trigger, which opens the tip after the delay.
EscDismisses the open tip while keeping focus on the trigger.
  • Opens on pointer hover and on keyboard focus; closes on blur, pointer-leave, or Esc.
  • Radix links the tip to its trigger via aria-describedby, so screen readers announce it.
  • Mount one TooltipProvider near the app root to share a single open-delay / skip-delay timer across every tooltip.
  • The tip is advisory only — the interface must remain fully usable without ever revealing it.

Tooltip props

PropTypeDefaultDescription
asChildboolean
children *ReactNodeThe trigger element the tip describes. Wrapped as the Radix trigger via `asChild`.
classNamestring
content *ReactNodeThe tip body. Anything renderable; kept short (single line ideal).
defaultOpenbooleanUncontrolled initial open state.
delayDurationnumber300Open delay in ms (overrides the provider's).
onOpenChange((open: boolean) => void)Fires when the open state changes.
openbooleanControlled open state.
sideenumtopPreferred side of the trigger to render on.
sideOffsetnumber6Pixel gap between trigger and tip.
styleCSSProperties

Related

  • PopoverA non-modal floating panel anchored to a trigger — for secondary controls, filters, and rich detail that shouldn't block the page.
  • HoverCardA rich preview panel revealed on hover — an entity card for a person, repo, or resource that a plain tooltip can't hold.
  • HelpTipA "?" glyph (or any trigger) that reveals an accessible tooltip using the PDS overlay skin.
  • KbdKey cap — a small sunken mono chip for keyboard shortcuts.