react-collapsible-content
v1.0.0
Published
A React Component to handle dynamic collapsible content
Downloads
259
Readme
react-collapsible-content
A React Component to handle dynamic collapsible content
Install
npm install --save react-collapsible-content
yarn add react-collapsible-content
Basic Usage
import React, { useState } from 'react';
import CollapsibleContent from 'react-collapsible-content';
function Toggle() {
const [expanded, setExpanded] = useState(false);
return (
<div>
<button onClick={() => setExpanded((prev) => !prev)}>TOGGLE</button>
<CollapsibleContent expanded={expanded}>
<p>
Lorem Ipsum is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the industry's
standard dummy text ever since the 1500s when an unknown
printer took a galley of type and scrambled it to make a
type specimen book.
</p>
</CollapsibleContent>
</div>
);
}
Documentation.
Read documentation.
License
MIT © llorentegerman