React-ellipsis-component Docs
English Docs
IntroductionInstallGetting StartedAPIPropsEvents
中文文档

API Referrer

Props

Prop NameTypeDefaultDescription
textStringRequiredPure text that you want to ellipsis. Support \n to wrap with useJsEllipsis={true}.
maxLineNumber1Content will be truncated if the line count of content is bigger than maxLine.
maxHeightNumberContent will be truncated if the height of content is bigger than maxHeight. Priority higher than maxLine.
classNameStringAdd className to component.
ellipsisBooleantrueWhether to ellipsis the text content.
ellipsisNodeReactNodeCustom the ellipsis node.
endExcludesString[][]The characters that want to remove at the end(Before ellipsis char).
dangerouslyUseInnerHTMLBooleanfalseParse text as html(Make sure the text that you pass is safe, or you may been attacked by XSS).
reflowOnResizeBooleanWhether update when container resize. Default true if native ellipsis support, otherwise false.
visibleLineNumbermaxLineLine count of visible content(Can't bigger than maxLine).
visibleHeightNumberVisible height of content. Priority higher than visibleLine.

Events

Event NameTypeDescription
onReflow(ellipsis: Boolean, text: String) => voidReflow callback, ellipsis is whether the text have been truncated. text is the visible content after truncating(Not include ellipsis char).
onEllipsisClick() => voidEllipsis click callback.