Skip to content

Latest commit

 

History

History
44 lines (37 loc) · 1.46 KB

README.md

File metadata and controls

44 lines (37 loc) · 1.46 KB

React Read More Read Less

NPM npm version license-isc

Install

npm install react-read-more-read-less --save

Usage

import ReactReadMoreReadLess from "react-read-more-read-less";

class myComponent extends Component {
    render() {
        return (
            <ReactReadMoreReadLess
                charLimit={200}
                readMoreText={"Read more ▼"}
                readLessText={"Read less ▲"}
            >
                {myLongText}
            </ReactReadMoreReadLess>
        );
    }
}

Test on CodeSandbox

PROPTYPES

Prop Type Default
charLimit integer 150
ellipsis String
readMoreText String Read more
readLessText String Read less
readMoreClassName String react-read-more-read-less react-read-more-read-less-more
readLessClassName String react-read-more-read-less react-read-more-read-less-less
readMoreStyle object {whiteSpace: "nowrap", textDecoration: "none"}
readLessStyle object {whiteSpace: "nowrap", textDecoration: "none"}