Responsive React Accordion
Installation
npm i responsive-react-accordion
yarn add responsive-react-accordion
Demo

Usage
import { Accordion } from 'responsive-react-accordion';
Simple example
<Accordion
title='This is an awesome react accordion'
content='This is hell awesome 🔥'
/>
Render prop example
<Accordion
title='This is an awesome react accordion'
content='This is hell awesome 🔥'
openIcon={Opening Icon}
closeIcon={Closing Icon}
spacing={10}
/>
Props
Prop |
Type |
Description |
title |
String |
The title of the accordion. |
content |
String |
The content inside the accordion. |
spacing |
Number |
The spacing between the accordion. |
openIcon |
any |
The customizable opening icon. |
closeIcon |
any |
The customizable closing icon. |
Complete example
import { Avatar } from 'user-profile-avatar'
function App() {
return (
<div className="App">
<Avatar
src='Enter your image Link'
alt='profile'
size={80}
/>
</div>
);
}
export default App;
CSS Styling access to containers
.accordion-container {
}
.accordion {
background-color: #0d152d;
border: 2px solid white;
border-radius: 12px;
color: white;
}
.accordion-title {
font-size: 20px;
font-weight: 600;
}
.accordion-collapsible {
background-color: white;
border-bottom-left-radius: 12px;
border-bottom-right-radius: 12px;
color: black;
}
.accordion-icon {
width: 20px;
}