react-showhide-component
Install
Using npm:
npm install --save react-showhide-component
or using yarn:
yarn add react-showhide-component
Usage
import React Component from 'react' import ReactShowHideComponent from 'react-showhide-component' const arr = 1 2 3 4 5; { const listHtml = arr; return <ReactShowHideComponent = = />; }
Props
Property | Type | Default | Description |
---|---|---|---|
items |
string | array | undefined | Array of elements of string |
minItems |
number | undefined | No of element(for array) / lines (for string) to show by default |
mode |
string | array | 'array' or 'string' |
viewMoreButton |
element | View More |
View more button |
viewLessButton |
element | View Less |
View less button |
License
MIT © https://github.com/vaibhavdiwani
Any help in improvement/optimization is very much appreciated