Back to Twenty

App Tooltip

packages/twenty-docs/twenty-ui/display/app-tooltip.mdx

2.2.02.5 KB
Original Source
<Frame> </Frame>

A brief message that displays additional information when a user interacts with an element.

<Tabs> <Tab title="Usage">
jsx
import { AppTooltip } from "@/ui/display/tooltip/AppTooltip";

export const MyComponent = () => {
  return (
    <>
      <p id="hoverText" style={{ display: "inline-block" }}>
        Customer Insights
      </p>
      <AppTooltip
        className
        anchorSelect="#hoverText"
        content="Explore customer behavior and preferences"
        delayHide={0}
        offset={6}
        noArrow={false}
        isOpen={true}
        place="bottom"
        positionStrategy="absolute"
      />
    </>
  );
};
</Tab> <Tab title="Props">
PropsTypeDescription
classNamestringOptional CSS class for additional styling
anchorSelectCSS selectorSelector for the tooltip anchor (the element that triggers the tooltip)
contentstringThe content you want to display within the tooltip
delayHidenumberThe delay in seconds before hiding the tooltip after the cursor leaves the anchor
offsetnumberThe offset in pixels for positioning the tooltip
noArrowbooleanIf true, hides the arrow on the tooltip
isOpenbooleanIf true, the tooltip is open by default
placePlacesType string from react-tooltipSpecifies the placement of the tooltip. Values include bottom, left, right, top, top-start, top-end, right-start, right-end, bottom-start, bottom-end, left-start, and left-end
positionStrategyPositionStrategy string from react-tooltipPosition strategy for the tooltip. Has two values: absolute and fixed
</Tab> </Tabs>

Overflowing Text with Tooltip

Handles overflowing text and displays a tooltip when the text overflows.

<Tabs> <Tab title="Usage">
jsx
import { OverflowingTextWithTooltip } from 'twenty-ui/display';

export const MyComponent = () => {
  const crmTaskDescription =
    'Follow up with client regarding their recent product inquiry. Discuss pricing options, address any concerns, and provide additional product information. Record the details of the conversation in the CRM for future reference.';

  return <OverflowingTextWithTooltip text={crmTaskDescription} />;
};
</Tab> <Tab title="Props">
PropsTypeDescription
textstringThe content you want to display in the overflowing text area
</Tab> </Tabs>