Have ideas to improve npm?Join in the discussion! »

    react-text-truncate
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/react-text-truncate package

    0.16.0 • Public • Published

    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.

    Install

    npm i react-text-truncate

    DownloadsWeekly Downloads

    25,168

    Version

    0.16.0

    License

    MIT

    Unpacked Size

    609 kB

    Total Files

    22

    Last publish

    Collaborators

    • avatar