react-clamp-lines icon indicating copy to clipboard operation
react-clamp-lines copied to clipboard

Support customization of overflow element

Open wencyen opened this issue 2 years ago • 1 comments

Hello there,

I am looking for a way to pass in any react element in place of the overflow text. My use case is as follows

Given that a developer is using react-clamp-lines component
The developer should be able to pass int a custom prop `overFlowElement` that allows them to substitute the more / less text with any react element

In my case, I'd like to be able to substitute it with a link that says, "Continue reading .." and it should allow me to link from the text to a different page in my application. I don't believe this feature is currently supported by react-clamp-lines, does anyone have any suggestions for workarounds in the meantime? For reference, shittake has support for this feature and they call it overflowNode.

Thank you

wencyen avatar Jan 31 '23 19:01 wencyen

@codepath2019 The easiest workaround would be:

  1. Set buttons={false} to hide them
  2. Create the Continue reading.. link below the component that points to a different page.

zoltantothcom avatar Feb 01 '23 15:02 zoltantothcom