ShinyChang / React-Text-Truncate

Truncate multi-lines text for all browsers base on react.js

Home Page:http://ShinyChang.github.io/React-Text-Truncate/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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}
    element="span"
    truncateText="…"
    text="Lorem Ipsum is simply dummy text of the printing and typesetting industry."
    textTruncateChild={<a href="#">Read on</a>}
/>

Demo

FAQ

  1. Why TextTruncate not shown after display changed?

    You must trigger update manually.

  2. Will TextTruncate support IE10 or below?

    No! IE 10 and below are dead according to Microsoft post.

About

Truncate multi-lines text for all browsers base on react.js

http://ShinyChang.github.io/React-Text-Truncate/

License:MIT License


Languages

Language:JavaScript 91.0%Language:HTML 9.0%