1.0.3 • Published 9 months ago

react-truncate-inside v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

React Truncate Inside

React component for adding an ellipsis to the middle of a line of text.

Inspired by pablosichert / react-truncate

CPT2308101505-376x87

Online Demo


Install

npm install react-truncate-inside

Usage

import React from 'react';
import Truncate from 'react-truncate-inside';

export default function Demo() {
    return <Truncate text="An-Extremely-Long-Filename.pdf" width="100" />
}

Props

NameTypeDescDefault
textstring
widthnumberWidth of the elementparentNode.width
offsetnumberPosition(from the end) of the ellipsis that shows in text8
ellipsisstringEllipsis that is added into the text in case it is truncated'...'

License

MIT License

1.0.3

9 months ago

1.0.2

9 months ago

0.2.0

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago

0.1.0

9 months ago