Accordian Library for React native for both android and ios
Install the component through npm using:
npm install react-native-custom-accordian --save
import PanelList from "react-native-custom-accordian";
<PanelList
disableContentClick={true}
data={[
{ title: "click to expand", content: "test", expanded: false },
{ title: "click to expand", content: "test 1", expanded: false }
]}
renderContent={this.renderContent}
/>;
*
- mandatory
Props Name | Description |
---|---|
disableContentClick |
value defined to get click on content |
* data |
describes parameters in an array |
* renderContent |
function that renders content |
import Panel from "react-native-custom-accordian";
<Panel {...this.props} title={item.title} expanded={item.expanded}>
{this.props.renderContent(item)}
</Panel>;
*
- mandatory
Props Name | Description |
---|---|
* title |
The element that will expand the title when pressed. |
* expanded |
condition to check whether expanded or not. |
* renderContent |
The content you want hidden in the title. |