1.0.0 • Published 4 years ago

react-collapsible-content v1.0.0

Weekly downloads
88
License
MIT
Repository
github
Last release
4 years ago

react-collapsible-content

A React Component to handle dynamic collapsible content

NPM JavaScript Style Guide

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

Author

me

Germán Llorente