Skip to content

llorentegerman/react-collapsible-content

Repository files navigation

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

About

A React Component to handle dynamic collapsible content

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published