> ## 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.

# OverflowingTextTooltipModeProvider

> Choose when OverflowingTextWithTooltip checks truncation for a subtree.

export const StoryEmbed = ({storyId, title, height = 120}) => <>
    <Tabs>
      <Tab title="Light">
        <iframe title={`${title} (light)`} src={`https://storybook.twenty.com/iframe.html?id=${storyId}&viewMode=story&globals=colorScheme:light`} width="100%" height={height} loading="lazy" allow="clipboard-write" style={{
  border: 0
}} />
      </Tab>
      <Tab title="Dark">
        <iframe title={`${title} (dark)`} src={`https://storybook.twenty.com/iframe.html?id=${storyId}&viewMode=story&globals=colorScheme:dark`} width="100%" height={height} loading="lazy" allow="clipboard-write" style={{
  border: 0
}} />
      </Tab>
    </Tabs>
    <a href={`https://storybook.twenty.com/?path=/story/${storyId}`}>
      Open in Storybook
    </a>
  </>;

`OverflowingTextTooltipModeProvider` sets how every [OverflowingTextWithTooltip](/ui/primitives/typography/overflowing-text-with-tooltip) inside it handles its tooltip. It renders no DOM element.

<StoryEmbed storyId="ui-typography-overflowingtexttooltipmodeprovider--display" title="Overflowing text tooltip mode provider example" height={180} />

## Usage

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

export const RecordCell = () => (
  <OverflowingTextTooltipModeProvider mode="measure-on-hover">
    <Text style={{ maxWidth: 220 }}>
      <OverflowingTextWithTooltip
        text="Quarterly account review and renewal preparation"
        isFocusable
      />
    </Text>
  </OverflowingTextTooltipModeProvider>
);
```

Hover or focus the truncated label to read its full value. Change `mode` in the Storybook controls to compare when the tooltip is available.

## Modes

* `measure-on-hover`, the default without a provider, checks truncation on pointer entry and focus. A label that fits stays out of the way of a parent tooltip.
* `measure-on-open` checks truncation when the tooltip tries to open. Use it for labels that mount under the pointer, such as a hover overlay, where no pointer entry happens.
* `disabled` renders only the text, without any tooltip parts. Use it for many labels that a user cannot hover, such as content covered by an overlay.

<StoryEmbed storyId="ui-typography-overflowingtexttooltipmodeprovider--disabled" title="Tooltip disabled for a subtree" height={90} />

Nested providers override the mode for their subtree.

## Props

<ParamField body="children" type="ReactNode" required>
  Content whose OverflowingTextWithTooltip instances use the mode.
</ParamField>

<ParamField body="mode" type="&#x22;disabled&#x22; | &#x22;measure-on-hover&#x22; | &#x22;measure-on-open&#x22;" required>
  `measure-on-hover` checks truncation on pointer entry and focus. `measure-on-open` checks it when the tooltip tries to open. `disabled` renders only the text.
</ParamField>


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