> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twenty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OverflowingTextWithTooltip

> Truncate long text and reveal its full value in a tooltip.

## Overview

`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](https://docs.twenty.com/ui/primitives/typography/overflowing-text-tooltip-mode-provider) to change when a subtree checks truncation or to turn the tooltip off.

> [tab] Light
>
> [OverflowingTextWithTooltip example (light)](https://storybook.twenty.com/iframe.html?id=ui-surfaces-overflowingtextwithtooltip--display\&viewMode=story\&globals=colorScheme:light)

> [tab] Dark
>
> [OverflowingTextWithTooltip example (dark)](https://storybook.twenty.com/iframe.html?id=ui-surfaces-overflowingtextwithtooltip--display\&viewMode=story\&globals=colorScheme:dark)

[Open in Storybook](https://storybook.twenty.com/?path=/story/ui-surfaces-overflowingtextwithtooltip--display)

## Usage

```tsx theme={null}
import {
  OverflowingTextWithTooltip,
  Text,
} from 'twenty-ui/primitives/typography';

export const RecordTitle = () => (
  <Text style={{ maxWidth: 220 }}>
    <OverflowingTextWithTooltip
      text="Quarterly account review and renewal preparation"
      isFocusable
    />
  </Text>
);
```

Constrain the width of the surrounding layout so truncation can occur. `isFocusable` gives the text a tab stop and opens the tooltip on focus or click. Keep essential information available to users who cannot hover.

## Choose typography

`size`, `weight` and `color` match [Text](https://docs.twenty.com/ui/primitives/typography/text.md). They are optional and inherit independently when omitted. Explicit typography applies to the displayed text; the tooltip retains its shared appearance.

```tsx theme={null}
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';

export const WorkspaceCaption = () => (
  <OverflowingTextWithTooltip
    text="Quarterly account review and renewal preparation"
    size="xs"
    weight="semibold"
    color="light"
    style={{ maxWidth: 220 }}
  />
);
```

## Multiline content

```tsx theme={null}
import {
  OverflowingTextWithTooltip,
  Text,
} from 'twenty-ui/primitives/typography';

export const RecordDescription = () => (
  <Text style={{ maxWidth: 220 }}>
    <OverflowingTextWithTooltip
      text="Review the account history, confirm the renewal date, and prepare the next conversation with the customer."
      lineClamp={2}
      isTooltipMultiline
      isFocusable
    />
  </Text>
);
```

`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

```tsx theme={null}
import {
  OverflowingTextWithTooltip,
  Text,
} from 'twenty-ui/primitives/typography';

export const ImportResult = () => (
  <Text style={{ maxWidth: 220 }}>
    <OverflowingTextWithTooltip
      text={<strong>24 records imported successfully</strong>}
      tooltipContent="24 records imported successfully"
      tooltipPlace="top"
      tooltipDelay={300}
      isFocusable
    />
  </Text>
);
```

React content requires a plain-string `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 unless an explicit typography prop is supplied. 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](https://docs.twenty.com/ui/primitives/typography/text.md) and [Tooltip](https://docs.twenty.com/ui/primitives/surfaces/tooltip.md) directly when you need custom composition. Interactive popup content belongs in [Popover](https://docs.twenty.com/ui/primitives/surfaces/popover.md).

## Explicit links

```tsx theme={null}
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';

export const DocumentationLink = () => (
  <OverflowingTextWithTooltip
    text="https://twenty.com/developers"
    render={
      <a href="https://twenty.com/developers" aria-label="Documentation" />
    }
    style={{ maxWidth: 160, display: 'block' }}
  />
);
```

Use a single anchor for the whole label, or supply individual anchors in React content with a plain `tooltipContent`. The component adds no anchors of its own. Keep tooltip content informational.

## Migration

Replace `displayedMaxRows` with `lineClamp`. The former `size="small"` and `size="large"` options controlled height, not font size. `large` set a 16px height. The new `size` selects theme font sizes and accepts no legacy aliases; use native `style` or `className` for height constraints. `color` now accepts semantic colors; move arbitrary CSS colors to `style={{ color: customColor }}`. Move intentional URL recognition into caller-owned content. No automatic linkification remains in this component.

## Props

**alwaysShowTooltip** `boolean`

Allows the tooltip even when the text is not truncated.

**color** `"light" | "primary" | "secondary" | "tertiary"`

Semantic text color. Omitted values inherit; native style supports runtime colors.

**isFocusable** `boolean`

Adds an optional tab stop. Native tabIndex and focusable render elements also open the tooltip on focus.

**isTooltipMultiline** `boolean`

Preserves whitespace and line breaks in the tooltip.

**lineClamp** `number`

Positive integer limiting visible lines, matching Text. Cannot be combined with `truncate`.

**render** `ReactElement\<unknown, string | JSXElementConstructor\<any\>\> | ComponentRenderFn\<HTMLProps, \{\}\>`

Replaces the default div. Native props, styles, handlers and ref target the displayed text, not the popup.

**size** `"lg" | "md" | "sm" | "xl" | "xs" | "xxl" | "xxs"`

Font size from the theme scale. Omitted values inherit; this does not set height.

**text** `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.

**tooltipContent** `string`

Plain text displayed in the tooltip. Defaults to nonempty string `text`.

**tooltipDelay** `number`

Hover delay in milliseconds.

**tooltipPlace** `"bottom" | "inline-end" | "inline-start" | "left" | "right" | "top"`

Preferred side of the tooltip.

**truncate** `boolean`

Single-line ellipsis by default. Set false to wrap. Cannot be combined with `lineClamp`.

**weight** `"medium" | "regular" | "semibold"`

Theme font weight. Omitted values inherit.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.