@natahouse/react-ellipsis-with-tooltip
v1.1.0
Published
truncates (with ellipsis) overflowing text elements and adds a tooltip
Downloads
1
Readme
react-ellipsis-and-tooltip
Recognizes whether a text element is overflowed,
truncates (with ellipsis) it and adds bootstrap's tooltip.
Try via stroybook
Usage
Install package
npm install --save react-ellipsis-with-tooltip
Import it
import EllipsisWithTooltip from 'react-ellipsis-with-tooltip'
Wrap with text elements
Examples
Inside a table cell
<td>
<EllipsisWithTooltip placement="bottom">
Lorem Ipsum
</EllipsisWithTooltip>
<td>
Wrapping anchor element
<td>
<EllipsisWithTooltip placement="bottom">
<a href="#"> Lorem Ipsum </a>
</EllipsisWithTooltip>
<td>