Kombase
Components

LongText

Utility component for truncating long text with tooltip and popover support.

Overview

LongText automatically truncates overflowing text using CSS truncate.

When the content overflows:

  • Desktop → shows the full content inside a Tooltip
  • Mobile → shows the full content inside a Popover

Useful for:

  • Tables
  • Cards
  • Lists
  • Descriptions
  • Any layout with limited width

Examples

Basic Usage


Usage


Custom Styling


Table Example


Props

PropTypeDescription
childrenReact.ReactNodeText or content to render inside the component.
classNamestringAdditional class names applied to the truncated container.
contentClassNamestringAdditional class names applied to the tooltip/popover content.

Behavior

Screen SizeInteraction
Desktop (sm and above)Displays full text using Tooltip
Mobile (< sm)Displays full text using Popover

Notes

  • The component only enables tooltip/popover when the content is actually overflowing.
  • Overflow detection is based on element scrollWidth / offsetWidth.
  • Works best when the parent container has a constrained width.

How is this guide?

On this page