npm-accordion
v1.0.4
Published
---
Downloads
3
Readme
npm Accordion
npm Accordion is a simple React component for creating accordion-style interfaces.
Installation
To install npm Accordion, you can use npm or yarn:
npm install npm-accordion
or
yarn add npm-accordion
Usage
- Import the Accordion component into your React application:
import Accordion from 'npm-accordion';
- Place the
<Accordion />
component in your JSX where you want the accordion to appear:
<Accordion />
- Make sure you have provided the necessary data in a JSON file named
Accordiondata.json
. Each item in this file should have a uniqueid
,title
, andcontent
.
Example of Accordiondata.json
:
[
{
"id": "section1",
"title": "Section 1",
"content": "Content of section 1."
},
{
"id": "section2",
"title": "Section 2",
"content": "Content of section 2."
}
]
Dependencies
- React
- Bootstrap 5
License
This project is licensed under the ISC License.