Tooltip

A short dark label for a control, shown when the pointer rests on it or keyboard focus reaches it. Built on ui-sdk's Tooltip: it names an icon button and describes anything else, closes on Escape, and opens in the top layer. Opens at once by default.

BetaReady to use. Its API can still change in a minor release; the changelog says when.

import { SimpleTooltip, Tooltip, TooltipTrigger, TooltipContent } from "@leap-crm/design-system";

Playground

Change a prop and the component follows. Its code is under Props.

Props

label
disabled
delay
shortcut
side
align

Best practices

When to use it, and the rules that apply in particular places.

GuidancePractice
DoWrap an IconButton in SimpleTooltip for the common case: one label on one trigger, matching the button's aria-label.
DoPick the delay from tooltipDelay: quick names a control, deliberate suits form help and editor buttons, explanatory explains a label already on screen.
DoUse size="rich" with TooltipTitle, TooltipText and TooltipHint for more than one line, like the time an opportunity has spent in a stage.
Don'tPut a link, a button or the only copy of an error in a tooltip. It closes when the pointer moves away; use Popover for actions or HoverCard for a preview.
Don'tAdd a tooltip by hand to show a cut-off value. Use Truncate, which shows the whole value only while it is clipped.
Don'tColour custom tooltip text with text-neutral-surface. The tooltip stays dark in dark mode, so use text-on-tooltip, as its parts do.

Props

Tooltip also takes ui-sdk's Tooltip options (open, defaultOpen, onOpenChange, closeDelay, toggleable, closeOnPress, type, controller). TooltipContent takes its position props (collisionPadding, anchor, container), and TooltipTrigger takes render and payload.

SimpleTooltip

PropTypeDefaultDescription
label *ReactNode—What the tooltip says. Nothing (null, undefined or false) renders the trigger alone.
children *ReactElement—The one element it labels, like an IconButton.
disabledboolean—Keeps the trigger but never opens.
delaynumber—How long the pointer rests before it opens.
shortcutstring—A keyboard shortcut to show after the label, like `"mod+s"`.
sideTooltipContentProps["side"]—Which side it opens on. It flips to the other when there isn't room.
alignTooltipContentProps["align"]—How it lines up along that side: start, center or end.

Tooltip

PropTypeDefaultDescription
delaynumber0How long the pointer rests before it opens.

TooltipContent

PropTypeDefaultDescription
childrenReactNode—What it shows inside.
size"plain" | "rich""plain"Plain for a short label. Rich for a title with lines under it, built from TooltipTitle, TooltipText and TooltipHint.
classNamestring—Classes added to the root element, merged with its own. Tokens only.
sideTooltipContentProps["side"]"top"Which side it opens on. It flips to the other when there isn't room.
alignTooltipContentProps["align"]"start"How it lines up along that side: start, center or end.
sideOffsetunknown4The gap between it and what it opens from, in pixels.

TooltipTitle

PropTypeDefaultDescription
children *ReactNode—What it shows inside.
metaReactNode—A quieter value after the title.

TooltipText

PropTypeDefaultDescription
children *ReactNode—What it shows inside.

TooltipHint

PropTypeDefaultDescription
children *ReactNode—What it shows inside.

Code

What the playground shows, ready to copy.

import { Button, SimpleTooltip } from "@leap-crm/design-system";

<SimpleTooltip label="Add contact">
  <Button intent="outline">Hover me</Button>
</SimpleTooltip>

Icon buttons

The common case: SimpleTooltip around an IconButton. Move along the toolbar: once one tooltip is open, the next opens at once without animating, so nothing flickers. Shortcuts show in the platform's form.

Rich

More than one line: a title with a quieter value, secondary lines and a hint. Used on pipeline stages and avatar groups, below the trigger with 8 px between.

Wrapping

A long label wraps at 320 px rather than running off the page.

What the examples share

The imports and the scaffolding the examples above call. The scaffolding lives in this page, not in the library.

import { Bold, Italic, Link, List, Save, Settings, Strikethrough, Underline } from "lucide-react";

import { Button, IconButton, SimpleTooltip, Tooltip, TooltipContent, TooltipHint, TooltipText, TooltipTitle, TooltipTrigger, tooltipDelay } from "@leap-crm/design-system";

const formatting = [
  { label: "Bold", icon: <Bold />, shortcut: "mod+b" },
  { label: "Italic", icon: <Italic />, shortcut: "mod+i" },
  { label: "Underline", icon: <Underline />, shortcut: "mod+u" },
  { label: "Strikethrough", icon: <Strikethrough />, shortcut: undefined },
  { label: "Bulleted list", icon: <List />, shortcut: undefined },
  { label: "Link", icon: <Link />, shortcut: "mod+k" },
] as const;

Keyboard

The keys it answers to. Tab moves between components, arrows move within them.

KeysWhat they do
TabFocus on the trigger shows the tooltip.
EscapeCloses the tooltip and leaves focus on the trigger.