Skip to content

Vben EllipsisText

EllipsisText displays long text with truncation, tooltip support, and optional expand/collapse behavior.

Basic Usage

Pass the text through the default slot and limit the visual width with maxWidth.

Current Props

PropDescriptionTypeDefault
expandallow click-to-expand behaviorbooleanfalse
linemax visible line countnumber1
maxWidthmax width of the text areanumber | string'100%'
placementtooltip placement'bottom' | 'left' | 'right' | 'top''top'
tooltipenable tooltipbooleantrue
tooltipWhenEllipsisonly show tooltip when text is actually truncatedbooleanfalse
ellipsisThresholdpixel threshold used when checking truncationnumber3
tooltipBackgroundColortooltip background colorstring''
tooltipColortooltip text colorstring''
tooltipFontSizetooltip font size in pxnumber14
tooltipMaxWidthtooltip max width in pxnumber-
tooltipOverlayStyletooltip content styleCSSProperties{ textAlign: 'justify' }

Events

EventDescriptionType
expandChangefired when expand state changes(isExpand: boolean) => void

Slots

SlotDescription
tooltipcustom tooltip content

Contributors

The avatar of contributor named as xingyu4j xingyu4j

Changelog

Released under the MIT License.