A collapsible paragraph component for reactjs projects
npm install react-collapsible-paragraphA Collapsible Paragraph Component for Reactjs
!npm !NPM !npm type definitions
Customizable _expan/collapse_ handler
``shell`
yarn add react-collapsible-paragraphor
npm install react-collapsible-paragraph
`jsx
import React from "react";
import Collapsible from "react-collapsible-paragraph";
function App() {
return (
Essential
-
Collapsible inherits its parentElement's lineHeight which is necessay for the collapse mechanism. Therefore, parent must provide lineHeight propertyProps
| Props | Types | Expanation | Default |
| --------- | :----------------------------------- | :-------------------------------------------------------------------------------- | :----------------------------------------- |
|
lines | number | If the content is longer than a certain line number. The content can be collapsed | 2 |
| locales | {expand: string; collapse: string} | Locale for _expan/collapse_ handler based on controlled usage | {expand: "expand", collapse: "collapse"}` |