Tooltip

A React component in Beamline's Overlays category, in the free sample.

Short supporting text for a control: opens after a moment on hover and at once on keyboard focus; inside a toolbar group the next one opens instantly.

Use it for

  • Naming icon-only buttons and showing their keyboard shortcut.
  • Saying why a control is disabled and how to enable it.

Not for

  • Essential information (put it on the page).
  • Anything clickable or long (popover).

Anatomy

  • trigger (your control)
  • content
  • shortcut

Variants

  • side: top, right, bottom, left
  • align: start, center, end

States

  • closed
  • delayed-open (after 500 ms hover; arrives from its control's side)
  • instant-open (keyboard focus, or inside a group after another: travels from the last one)
  • closing

Keyboard

  • Focus opens it at once
  • Escape closes it

Motion

It arrives out of its control on whichever side it opens: it starts a step toward the control and moves away into place as it fades in over --pui-motion-in (a hover delay first; keyboard focus opens it at once with a fade). Inside a TooltipGroup the next one opens at once where the last one stood and travels to its own control over --pui-duration-fast while the last one leaves in the arrival time, so one tooltip moves along the toolbar. It fades out over the departure. Reduced motion keeps the fades and drops all travel.

Props

PropTypeDefaultDescription
contentReactNode—What the control does; a few words.
shortcutstring—A keyboard shortcut shown after the text, e.g. "⌘B".
side / alignstring"top" / "center"side: Edge from which the panel or anchored content opens. Defaults to "top". align: Alignment within the available space. Defaults to "center".
open / defaultOpen / onOpenChangeboolean—open: Open state, controlled or uncontrolled; the tooltip opens on hover and on keyboard focus either way. defaultOpen: Initial open state when uncontrolled. Defaults to false. onOpenChange: Reports open state after a change; no callback by default.
TooltipGroup delaynumber500delay: On TooltipGroup: Milliseconds before the first tooltip in the group opens. Defaults to 500.
classNamesTooltipClassNames—Classes for the named visual parts; no part overrides by default.
style / refCSSProperties / native Ref—style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default.
children (required)ReactElement<unknown, string | JSXElementConstructor<any>>—The control: one element that can take a ref (a button).
side"bottom" | "left" | "right" | "top"—Edge from which the panel or anchored content opens. Defaults to "top".
align"center" | "end" | "start"—Alignment within the available space. Defaults to "center".
openboolean—Open state, controlled or uncontrolled; the tooltip opens on hover and on keyboard focus either way.
defaultOpenboolean—Initial open state when uncontrolled. Defaults to false.
onOpenChange((open: boolean) => void)—Reports open state after a change; no callback by default.
classNamestring—Classes on the documented visual root; no override by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
refRef<HTMLDivElement>—Receives the documented root element; no ref by default.
TooltipGroup.delaynumber—On TooltipGroup: Milliseconds before the first tooltip in the group opens. Defaults to 500.

Used in

Dependencies

@radix-ui/react-tooltip

Import

import { TooltipGroup, Tooltip } from "@beamline/tooltip";

Get it

Tooltip is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Tooltip is included in the free MIT sample. Get Beamline · Connect your agent

More in Overlays

  • Command menu: Search-first list of every action: ranked matching, groups, keycap shortcuts and nested pages; inline as CommandPalette or in a ⌘K dialog as CommandMenu.
  • Toast: Short results of an action stacked at an edge: point at the stack to fan it out and pause the timers; undo or retry in place; Alt+T, Escape and a swipe…
  • Share dialog: Share a document, board or project: invite people by name or email with the access they get, change or remove anyone's access in place, and set who the…
  • Context menu: Actions for an object on right-click, long-press, Shift+F10 or the menu key, opened at the pointer, with the same rows as the dropdown menu.
  • Hover card: A preview of a person, link or record on hover or keyboard focus, without leaving the page; HoverCardProfile is the standard person preview.
  • Product tour: A short guided tour over the real interface: a spotlight that glides from one element to the next while the rest of the screen dims, and a card beside…
  • Bottom sheet: A phone panel that rests at a peek and follows the finger to full height; a flick down closes it, and the handle works from the keyboard.
  • Sheet: A panel that slides in from an edge with the page still visible behind it: header and footer stay put while the body scrolls.
  • Dropdown menu: A list of actions behind a trigger, with shortcuts, check items, headings and submenus; one highlight glides under the pointer and jumps with the keyboard.
  • Dialog: A focused task over the page (create, invite, rename) with a title, body and footer; focus moves in, is trapped and returns on close.
  • Alert Dialog: A blocking confirmation that must be answered: the scrim does not dismiss it, focus starts on the safe choice, and an async action keeps it open until…
  • Popover: A small surface anchored to a trigger for a short form, a filter or an explanation; focus moves in and returns on close.

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.