Tooltip
Simple text popup box.
When to use
- The tip is shown on mouse enter, and is hidden on mouse leave. The Tooltip doesn't support complex text or operations.
- To provide an explanation of a
button/text/operation. It's often used instead of the htmltitleattribute.
Examples
Content contrast
Neutral, muted and subtle CeeBee Text, plus Heading, inherit the tooltip container's foreground.
This keeps brief emphasized content readable on the tooltip's dark surface in either page theme.
Font size, weight and numeric formatting remain intact. Plain strings keep the upstream foreground;
semantic tones and explicit caller styles remain intentional author choices.
The adapter adds cb-tooltip-content through the upstream semantic container slot. Object and
callback classNames, custom colors and styles are preserved. Use Popover for structured explanations
or interactive content; its ordinary surface keeps its own text context.
API
Tooltip is exported from @ceebee/ui/client.
A supplementary tooltip must retain an existing field description on its trigger. The local runtime
pins Ant's @rc-component/tooltip dependency to 1.5.2: 1.5.1 replaced the trigger's
aria-describedby, disconnecting a Select from its hint. A regression spec checks the description
before and after opening the tooltip. The workspace override controls this repository's dependency
resolution; it is not a published override for a consuming application.
The exported Tooltip closes on Escape without moving trigger focus. When it is inside a dialog,
the first Escape dismisses the visible tip; a later Escape can close the dialog. Controlled open
remains owned by the caller: respond to onOpenChange(false) to close it. Native hover/focus triggers,
portal positioning, styling and refs are preserved. This is an additive dismissal adapter over Ant,
following WCAG guidance for content on hover or focus.
Use this explicit Tooltip around a focusable clipped text trigger when Escape dismissal is needed. Typography's internally generated ellipsis tooltip remains part of the upstream runtime; it does not pass through the exported adapter.
Tooltip
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
title | The text shown in the tooltip | ReactNode | () => ReactNode | - | - |
color | The background color. After using this attribute, the internal text color will adapt automatically | string | - | 5.27.0 |
classNames | Semantic DOM class | Record<SemanticDOM, string> | (info: { props }) => Record<SemanticDOM, string> | - | 5.23.0 |
styles | Semantic DOM style | Record<SemanticDOM, CSSProperties> | (info: { props }) => Record<SemanticDOM, CSSProperties> | - | 5.23.0 |