OverflowingTextWithTooltip truncates content within the available width. It checks for overflow on pointer entry and focus, then shows a tooltip only when needed. It manages tooltip visibility internally and exposes no controlled or uncontrolled open-state props. Use OverflowingTextTooltipModeProvider to change when a subtree checks truncation or to turn the tooltip off.
Usage
isFocusable gives the text a tab stop and opens the tooltip on focus or click. Keep essential information available to users who cannot hover.
Multiline content
lineClamp matches Text and limits the displayed lines; use a positive integer. isTooltipMultiline preserves whitespace and line breaks inside the tooltip. Without a row limit, text truncates on one line.
Custom content and timing
tooltipContent. With string text, that prop can override the tooltip label; otherwise the text itself is used. An empty or missing label does not open a tooltip. String URLs remain plain text. Supply links explicitly in text or through render. Link content and navigation stay caller-owned.
alwaysShowTooltip allows the tooltip even without truncation. tooltipDelay controls the hover delay and defaults to 500 milliseconds. tooltipPlace defaults to bottom.
Native attributes, styles, class names, event handlers, and refs target the displayed Text element, a div by default. render can replace that element while retaining truncation and tooltip behavior. OverflowingTextWithTooltipProps is exported from twenty-ui/primitives/typography. Typography inherits from the surrounding layout. Set truncate={false} to wrap; choose either truncate or lineClamp. Focusable rendered elements and a caller-supplied tabIndex also reveal the tooltip on focus. Use Text and Tooltip directly when you need custom composition. Interactive popup content belongs in Popover.
Explicit links
tooltipContent. The component adds no anchors of its own. Keep tooltip content informational.
Migration
ReplacedisplayedMaxRows with lineClamp. The removed size option controlled height, not font size; use native style or className for sizing. Move intentional URL recognition into caller-owned content. No automatic linkification remains in this component.
Props
boolean
Allows the tooltip even when the text is not truncated.
boolean
Adds an optional tab stop. Native tabIndex and focusable render elements also open the tooltip on focus.
boolean
Preserves whitespace and line breaks in the tooltip.
number
Positive integer limiting visible lines, matching Text. Cannot be combined with
truncate.ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>
Replaces the default div. Native props, styles, handlers and ref target the displayed text, not the popup.
string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...> | null | undefined
required
Caller-owned text or React content. Non-string content requires
tooltipContent. URLs stay plain text.string
Plain text displayed in the tooltip. Defaults to nonempty string
text.number
Hover delay in milliseconds.
"bottom" | "inline-end" | "inline-start" | "left" | "right" | "top"
Preferred side of the tooltip.
boolean
Single-line ellipsis by default. Set false to wrap. Cannot be combined with
lineClamp.