/React-Text-Truncate

Truncate text for React.js

Primary LanguageJavaScriptMIT LicenseMIT

React-Truncate-Text npm version

Install

npm install react-text-truncate

Usage

import TextTruncate from 'react-text-truncate'; // recommend
var TextTruncate = require('react-text-truncate'); // CommonJS or UMD

Markup

<TextTruncate
	line={1}
	truncateText="…"
	text="Lorem Ipsum is simply dummy text of the printing and typesetting industry."
	showTitle={true}
    raf={true}
    />

Demo

Changelog

  • 0.5.2 Fix server render bug
  • 0.5.1 Hide textTruncateChild when nothing truncated
  • 0.5.0 Add request animation frame
  • 0.4.0 New property textTruncateChild for show more or others
  • 0.3.7 Support CommonJS and UMD module loader
  • 0.3.5 Fix window resize issue
  • 0.3.4 supports Babel6
  • 0.2.0 supoorts React 0.14
  • 0.1.5 supports React 0.13.3 and below