1.6.0 • Published 6 years ago

react-text-ellipsis v1.6.0

Weekly downloads
3,743
License
MIT
Repository
github
Last release
6 years ago

React multi-line ellipsis

Build Status

Install

npm install react-text-ellipsis

Usage

Require TextEllipsis to wrap text (not any component!) and parent element must have width, height, overflow: hidden well set!, span tag is not working (div, p works)

Build react-text-ellipsis:

npm run build

Build example

npm run example

then see example/index.html

Example usage:

import TextEllipsis from 'react-text-ellipsis';

<label>
    <TextEllipsis 
        lines={2} 
        tag={'p'} 
        ellipsisChars={'...'} 
        tagClass={'className'} 
        debounceTimeoutOnResize={200} 
        useJsOnly={true} 
        onResult={(result) => { 
            if (result === TextEllipsis.RESULT.TRUNCATED)
                console.log('text get truncated');
            else 
                console.log('text does not get truncated');
            }}>
        Hello world
    </TextEllipsis>
</label>
 
1.6.0

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.0

7 years ago