1.0.9 • Published 3 years ago

read-more-read-less-toggler v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

read-more-read-less-toggler

It's truncate children text & visible Read More button to expand the collapse on specific pre-defined line overflow with collapse gradient effect.

Turncate Text with Read More Button

NPM JavaScript Style Guide

Demo

Codesandbox Link

Install

npm install --save read-more-read-less-toggler

Usage

import React from 'react'
import { ReadMoreToggler } from 'read-more-read-less-toggler'

const App = () => {
  return (
    <ReadMoreToggler>
      Some demo text...
    </ReadMoreToggler>
  )
}

export default App

The Options:

PropstypeDefault ValueDefination
mobileBreakLinesnumber5Number of line from which you want to turncate text for mobile view
desktopBreakLinesnumber3Number of line from which you want to turncate text for web view
topGradientstring#FFFFFFTop gradient color on the turncate collapse view
bottomGradientstring#25232363Bottom gradient color on the turncate collapse view
buttonColorstringParent DefinedRead More / Read Less button & caret icon color

Contributing

Pull requests are always welcome, but not all suggested features will get merged. Feel free to contact me if you have an idea for a feature.

License

MIT © Hasham-dev